| None. |
|
Returns the command line arguments the program was started with. Everything typed after the program's name is returned as a single string, exactly as entered - if there was nothing after the name you get "". Splitting it into individual options is up to you (Instr and Mid are your friends there). Command line arguments are great for switches you do not want in the game's UI: a -windowed flag, a level to jump straight into, a -debug option that turns on extra logging, or a file name passed to a tool you have written. To test this from the IDE, set a value under Program->Program Command Line and run - that text is what CommandLine$() will return. See also: SystemProperty, GetEnv, AppTitle. |
; CommandLine Example
; -------------------
; CommandLine$() returns any parameters the program was started with.
; To test in the IDE: open Program->Program Command Line, type /debug
; and run this example again.
args$=CommandLine$()
If args$="" Then
Print "No command line parameters were passed."
Print "Use Program->Program Command Line in the IDE to set some."
Else
Print "Command line received: "+args$
; React to a parameter, e.g. a debug switch for your game
If args$="/debug" Then Print "Debug mode is on!"
EndIf
Print ""
Print "Press any key to close the example"
WaitKey
End