Intrinsic-90 CommandLine

Top  Previous  Next

90: Valid:= CommandLine(Index, String, MaxLength);


This intrinsic is used to retrieve command-line data. The data are parsed into separate, individual arguments. Here is a description of the arguments:


Index: The index specifies which argument is retrieved. A zero index retrieves the first argument. The first argument is always the program name and path. Other indexes retrieve subsequent command line arguments.


String: This argument receives the command line argument. It should be an EXPL char-type variable, and you must reserve enough characters to hold the arguments.


MaxLength: This argument specifies the maximum number characters the intrinsic can store in the string. This value should be the same as the number of characters that you reserved for the String variable. If the specified command line argument is larger than MaxLength, the argument will be truncated to MaxLength.


Returned Value: The intrinsic returns "true" if there was a command line argument at the specified position. It returns "false" if there are no command line arguments at this index. This lets you loop through all the command line arguments and stop when the last argument is reached.