Control Flow Labels for Branching

Top  Previous  Next

 

A label defines the destination of a conditional or unconditional branching command. Labels always begin with a colon and must not exceed 32 characters in length. A label must be the first and only executable statement on a line but it may be preceded by white space.

 

The following is an example of an infinite loop where top is the label defining the destination of an unconditional branching command:

 

:top

CONSOLEMSG "Hello World"

GOTO top

 

Notice that the top label begins with a colon when it is declared but no colon is used when it is later used by the GOTO command.

 

Labels are only useful in multi-line command script files, they are not allowed in console command mode where each command is typed and executed one at a time.

Here is a list of commands that use labels to specify the a branching destination:

 

GOTO Immediate unconditional jump to label
IFDATE Conditional branch upon file date comparison
IFDATETIME Conditional branch upon file date time comparison
IFERROR Conditional branch after testing result code
IFFILE Conditional branch on file existence
IFNFILE Conditional branch on file non-existence
IFNO Conditional branch if ‘No’ is clicked in ASK dialog box
IFNSTRCMP Conditional branch when two string variables are not equal
IFNSUBSTR Conditional branch if sub-string is not found in string variable
IFNUM Conditional branch upon numeric variable comparison
IFSIZE Conditional branch upon file size comparison
IFSTRCMP Conditional branch when two string variables are equal
IFSUBSTR Conditional branch if sub-string is found in string variable
IFTIME Conditional branch upon file time comparison
IFYES Conditional branch if ‘Yes’ is clicked in ASK dialog box
LOOPIF Conditional branch used in conjunction with LOOPCOUNT
LOOPTO Unconditional branch used in conjunction with LOOPCOUNT

 

Note: Robo-FTP supports up to a total of 320 unique labels at once. This is much more than a typical script will ever use but beware of the limit, especially if your process makes heavy use of the CALL and/or CHAIN commands to execute multiple script files in sequence.