SamIWas Posted July 28, 2016 Share Posted July 28, 2016 I feel like I'm missing something very simple. I've been writing scripts for years, but have never put an abort in them. All I want to do it be able to tell the script to abort if something is true. I know that I can tell a loop not to run again if the variable is true and then tell future parts of the script to not run, but it seems like there must be an immediate "abort" command. I've googled every combination of cancel, end, exit, abort, script, plugin, etc that I can think of but have not found an answer. I'm sure I've seen it before, and an just spacing out. Any answers? Quote Link to comment
Hippocode Posted July 28, 2016 Share Posted July 28, 2016 Since its based on pascal I'd think Exit should work ? http://www.freepascal.org/docs-html/rtl/system/exit.html could it be that you tried to call it nested which requires a number if you want to exit parent subroutines as well? Quote Link to comment
MullinRJ Posted July 28, 2016 Share Posted July 28, 2016 Sam, You can use GOTO , which causes the execution to jump to the label. GOTO will not jump out of nested procedures, so you'll have to have a and a GOTO at each level to jump to the end of that level when some condition is TRUE. Declare labels at the top of the program or procedure as: LABEL ; EXAMPLE: procedure xyz; Label 88; Begin ... GOTO 88; ... 88: End; { xyz } From the VS Language Guide: The general syntax for a GOTO statement is: GOTO ; GOTO statements have several cautions which must be observed whenever using them: • GOTO statements can only transfer execution within the same procedure, function, or main body of a script. They cannot be used to jump between procedures or between scripts. • The destination of a GOTO statement must always be the beginning of a statement. • Jumping to statements that are contained within the structure of other statements can have undefined effects; the VectorScript compiler will not recognize this action as an error. Raymond Quote Link to comment
SamIWas Posted July 28, 2016 Author Share Posted July 28, 2016 Thanks for the info. When writing scripts in Filemaker, there is an "Exit Script" command, which exits the script immediately. Thought there might be such a thing for VS. I'll look into the Label routine. Quote Link to comment
Miguel Barrera Posted July 29, 2016 Share Posted July 29, 2016 If you use the debugger when testing a script, you can exit at any time. Quote Link to comment
SamIWas Posted August 10, 2016 Author Share Posted August 10, 2016 The GOTO label thing has solved my problem. Odd to not have an abort action, but this works. Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.