EndWhile
EndWhile
Use in conjunction with While to create a loop. The code between While and EndWhile will repeat while condition is true.
Note: that the condition is evaluated at the start of the loop and therefore at the start of each iteration.
EndWhile Example
Let>x=0
While>x<10
Let>x=x+1
MessageModal>x
EndWhile
Gosub
Gosub>Subroutine_Name[,value1[,value2[,...]]]
Branches to the specified subroutine (SRT). When that the subroutine returns, processing continues at the next line after the Gosub command.
Subroutines can be nested. Subroutines can be located anywhere within the script.
If values are passed on the Gosub line variables will be created to contain these values. The variables are named with the following format: SubroutineName_Var_1, Subroutine_Var_2, ... Subroutine_Var_n
Gosub Example
Gosub>EnterName
Gosub>CloseApp
//// Subroutines Below ////
SRT>FocusApp
SetFocus>Data Entry Screen
End>FocusApp
SRT>EnterName
Gosub>FocusApp
Send>Firstname
Press Tab
Send>Surname
Press Enter
End>EnterName
SRT>CloseApp
Gosub>FocusApp
Press ALT
Press F4
Release ALT
End>CloseApp
Goto
Goto>Label_Name
Causes execution to continue at the specified label, missing any commands in between. If the label does not exist an error message will be displayed.
Label_Name can be or include a variable name.
Goto in conjunction with Label, can be used to create infinite loops. Use the If.. commands to cause conditional branching. To break out of infinite loops press Stop, or choose the Break option from the taskbar pop up menu.
Goto Example
Label>Start
..
..
Goto>SecondBit
..
..
Label>SecondBit
..
Label
Label>Label_Name
Marks a point in the script to allow execution to be passed to that point by the Goto, and If.. commands.
Goto in conjunction with Label, can be used to create infinite loops. Use the If.. commands to cause conditional branching. To break out of infinite loops press Stop, or choose the Break option from the taskbar pop up menu.
Label Example
Label>Start
..
..
Goto>SecondBit
..
..
Label>SecondBit
..
Repeat
Repeat>variable
Use in conjunction with Until. Iterates the code from the Repeat statement to the Until statement until the specified expression in the Until statement becomes true. Until can take one of the following simple expressions:
variable,value |
for backward compatibility. Same as variable=value |
variable=value |
Until variable equals the value specified |
variable>value |
Until variable is greater than the value specified |
variable<value |
Until variable is less than the value specified |
variable<>value |
Until variable does not equal the value specified |
Alternatively Until can take a full complex expression (specified between curly braces).
Until will loop back to the last Repeat that has the same counter variable.
Repeat Example
GetFileList>c:\temp\*.*,files
Separate>files,;,file_names
MessageModal>Num Files: %file_names_count%
Let>k=0
Repeat>k
Let>k=k+1
Message>file_names_%k%
Until>k,file_names_count
SkipLabel
SkipLabel>Label_Name
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: Note that SkipLabel is NOT supported by OnEvent subroutines.
SkipLabel ExampleLet>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
Until
Until>variable,finalvalue
Use in conjunction with Repeat. Iterates the code from the Repeat statement to the Until statement until the specified expression in the Until statement becomes true. Until can take one of the following simple expressions:
variable,value |
for backward compatibility. Same as variable=value |
variable=value |
Until variable equals the value specified |
variable>value |
Until variable is greater than the value specified |
variable<value |
Until variable is less than the value specified |
variable<>value |
Until variable does not equal the value specified |
Until will loop back to the last Repeat that has the same counter variable.
Until Example
GetFileList>c:\temp\*.*,files
Separate>files,;,file_names
MessageModal>Num Files: %file_names_count%
Let>k=0
Repeat>k
Let>k=k+1
Message>file_names_%k%
Until>k,file_names_count
While
While>condition
Use in conjunction with EndWhile to create a loop. The code between While and EndWhile will repeat while condition is true.
Note: Note that the condition is evaluated at the start of the loop and therefore at the start of each iteration.
While can take one of the following simple expressions:
variable,value |
for backward compatibility. Same as variable=value |
variable=value |
Until variable equals the value specified |
variable>value |
Until variable is greater than the value specified |
variable<value |
Until variable is less than the value specified |
variable<>value |
Until variable does not equal the value specified |
Alternatively While can take a full complex expression (specified between curly braces).
While Example
Let>x=0
While>x<10
Let>x=x+1
MessageModal>x
EndWhile
Comments
0 comments
Please sign in to leave a comment.