Jump to content
Developer Wiki and Function Reference Links ×

Abort script upon action/variable


Recommended Posts

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?

Link to comment

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

Link to comment
  • 2 weeks later...

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...