SEEK(ARG.[,n]) [THEN statements] [ELSE statements]
|n||Optional — An integer specifying which command line argument to point to. The default is the first unread argument (the next argument).|
The SEEK(ARG.) statement points to a command line argument. Each time you invoke SEEK(ARG.) it updates a command line pointer. Therefore, repeated invocation of SEEK(ARG.) without the n argument results in sequentially pointing to each command line argument in left-to-right order.
The keyword ARG. (note the period at end of this keyword) and the surrounding parentheses are mandatory.
You can use the optional n value to point to a command line argument by its integer position in the command line argument list. Command line arguments are counted from 1. If n=0, SEEK(ARG.) points to the next command line argument.
SEEK(ARG.) considers all values following the program name to be command line arguments. Command line arguments are separated by blank spaces; a blank space within a quoted string is not treated as a command line argument separator.
You can optionally specify a THEN clause, an ELSE clause, or both a THEN and an ELSE clause. If moving the pointer to the command line argument is successful, the THEN clause is executed. If there are no command line arguments, no more command line arguments, or if you specify a value of n that does not correspond to a command line argument, SEEK(ARG.) executes the ELSE clause. The statements argument can be the NULL keyword, a single statement, or a block of statements terminated by the END keyword. A block of statements has specific line break requirements: each statement must be on its own line and cannot follow a THEN, ELSE, or END keyword on that line.
The GET(ARG.) statement both moves the command line argument pointer and retrieves the argument value. The SEEK(ARG.) statement just moves the command line argument pointer. The EOF(ARG.) function returns whether or not the command line argument pointer is past the end of the list of command line arguments.