SkipLabel


 

SkipLabel>LabelName

 

SkipLabel is used within a subroutine to tell the script to jump to a label after the subroutine has ended.  It is bad practice to jump out of a subroutine using a Goto statement - as the subroutine may then never end, causing problems with, for example, OnEvent handlers.  In some cases however it is useful to cause the script to jump to a label once the subroutine has finished.  This is what SkipLabel does.

 

Note that SkipLabel is NOT supported by OnEvent subroutines.

 

Example

 

Let>x=0

Repeat>x

  Let>x=x+1

  GoSub>ExampleSubroutine

Until>x=100

 

SRT>ExampleSubroutine

  If>x=5

    SkipLabel>EndScript

  Endif

  //this bit still gets executed

  Let>y=x

END>ExampleSubroutine

 

Label>EndScript

MessageModal>y