COMMAND$

Format

string1 = COMMAND$

Description

This statements retrieves any command line arguments that were entered and stores them in string1.

Example

If your program was invoked with: MYPROG XXX
And if your program MYPROG.ASI contained the following:
A$=COMMAND$ A$=LTRIM$(A$)
IF A$="" THEN
     PRINT "Enter File Name ";
     INPUT A$
ENDIF
OPEN "I", 1, A$
The above example would open file "XXXX" for input. If the user had invoked the program by typing "MYPROG" with no parameters, then the program would prompt for the file name to open.

See Also

In the integrated environment, you can specify command line arguments on the "Run" Menu.
If this statement is used within a SUB/ENDSUB block, the results returned by ASIC are unpredictable (i.e., the command tail is not accessible in a SUB).
This statement is an extension over BASICA/GWBASIC.