t, n, console = GetCommandLine()
GetCommandLine()
returns three values: The second return value is a number
which simply specifies how many arguments have been passed to your
script from the command line. The first return value is a table which
contains all arguments and their parameters. The table is an array of
"n"-tables with the items arg
and param
. arg
will be initialized
to the argument excluding the dash character. param
will receive the
parameter for that argument if there is one, else it will be receive
an empty string (""). The third return value is new in Hollywood 4.7
and indicates whether or not Hollywood was started from a console. In
that case, the third return value will be True
, else it will be False
.
Under AmigaOS this function will also take the tooltypes of the script's or applet's icon into account if the program was started from Workbench.
Under macOS this function will look into the CFBundleExecutableArgs
dictionary entry in the application bundle's Info.plist if the program
was started from Finder.
True
if program was started from a console, otherwise False
(V4.7)args, count = GetCommandLine() NPrint("Number of arguments:", count) For Local k = 0 to count - 1 NPrint("Arg #", k, ":", args[k].arg, "Param:", args[k].param) NextThe code above gets all arguments from the command line and prints them to the screen.