initDefault()
Initializes a variable defined with the Getopt
type.
Syntax
Getopt.initDefault(
options GetoptOptions
)
- options is a
GetoptOptionsarray that holds the definition of the command line options.
Usage
This is a method for the Getopt type, used to initialize the variable of this type, using the
current program name (arg_val(0)) and where the command line argument starting
index is 1 (copyArguments(1)).
A variable of the type Getopt must be defined, as well as a GetoptOptions
dynamic array containing the definitions of the command line options for the current program.
After initializing the Getopt record, use the getopt() method to parse
and validate command line options.
Example
IMPORT FGL getopt
MAIN
DEFINE g getopt.Getopt
DEFINE _options getopt.GetoptOptions = [ ... ]
CALL g.initDefault(_options)
WHILE g.getopt() == getopt.SUCCESS
...
END WHILE
END MAIN