10-17-2010, 05:35 PM
Function ParseCommandLine
example
Macro Macro1465
;/
function $cmdLine ARRAY(str)&a
;Parses command line.
;Uses the same rules as most programs. <link "http://www.google.com/search?q=site%3amicrosoft.com%20Parsing%20C%2b%2b%20Command-Line%20Arguments">Read more</link>.
;cmdLine - command line.
;;;Can be path followed by command line. Then a[0] will be the path.
;a - receives command line arguments.
a=0
if(empty(cmdLine)) ret
int i n
word** w=CommandLineToArgvW(@cmdLine &n)
for(i 0 n) a[].ansi(w[i])
LocalFree w
example
Macro Macro1465