10.3. Handling command line arguments

[<<<] [>>>]

Though the command line is parsed by the interpreter up to the name of the executable basic program name and all other command line options and arguments are passed to the basic program to handle. To access this part of the command line the basic program should use the function command(). This function does not need any argument and returns a string containing the command line arguments.

In the variation STANDARD the command line returned by the function command() contains the parameters separated by a single space. Even if the real command line contains multiple spaces or tabs between the parameters it is converted to a list of parameters separated by single space.

' This program demonstrates the command function
' start the program using the command line:
'     scriba commandline.bas a b c d e f
'
print "The command line was:\n",command(),"\n"

will print

The command line was:
a b c d e f

[<<<] [>>>]