2 Replies Latest reply on Jun 24, 2015 10:10 PM by ultranix

    Stop current script and load new one



      Stop current script and load new one


      I have an open script, which, depending on the filename, runs different startup script.

      It's basically a bunch of IF THEN sequences and each sequence is IF (condition) then PERFORM SCRIPT, End If.

      What's really annoying, that if I use Exit Script step just above End If, it would stop another scripts from running.

      And what I want to achieve is: Once the IF condition is met, it should perform a script and exit that startup script, letting it continue to run other scripts.

      How do I do this?

        • 1. Re: Stop current script and load new one

          I think that you are confusing "halt script" with "Exit script". What you describe sounds like what you get when you use Halt Script and the solution is usually to replace Halt Script with Exit Script. Halt script halts all paused scripts where Exit only terminates the current script.

          If that's not the case here, you'll need to describe your script in more detail or post a portion of it.

          • 2. Re: Stop current script and load new one

            Here, take a look. I highlighted the place where I disabled the "Exit Script" step.

            I use this to batch-process my stock portfolio, so that _PORT file is controlling file and it opens various stock files, run several scripts, exports data from stock files, closes them, imports to _PORT file and does it over and over again until the list is complete.

            Previously, I would set different Opening scripts for _PORT and for stock files. Yesterday I created a conditional opening script, that would load a particular script based on calculation derived from Filename (Get(Filename) and Get(FilePath) used here).

            For other parts (you see multiple IF statements in the screen), because they use single script, this works and that exit script simply prevents from checking other conditions. But as for that 19th-20th row in the image I posted, this doesn't work quite well, because here the sequence is following:

            1- Perform several actions in the same file
            2- Perform script Open File (which opens the stock file)
            3- Once the stock file is opened, it should be triggered with it's own startup script

            And it between steps 2 and 3 here, my conditional startup script resumes, and what do we get here? Exit script step, that completely exits not just the running script, but also other scripts, so i'm not getting 3rd step of the above mentioned sequence completed: file is not opened, or, if it's opened, it's own startup script is not running.