Equivalent Function to CommandLine$ ?

BlitzMax Forums/BlitzMax Beginners Area/Equivalent Function to CommandLine$ ?

SebHoll(Posted 2006) [#1]
Hi,

Just a quick question. Is there a replacement to the CommandLine$ function from BlitzPlus in BlitzMax. I.e. a function to return any arguments passed to the executable at run-time.

Cheers

Seb


EOF(Posted 2006) [#2]
Print "Applications path+filename = "+AppArgs[0]
Print "Number of arguments passed = "+AppArgs.length

For n=1 Until appargs.length
	Print AppArgs[n]
Next


you can test this by entering arguments in the MAX IDE command line window ..

hello goodbye "third argument" last
Note how enlosing text in double-quotes counts as 1 argument.


N(Posted 2006) [#3]
Or
For Local s:String = EachIn AppArgs
  Print s
Next



SebHoll(Posted 2006) [#4]
Brilliant! Thanks