Command-line arguments: Difference between revisions

Line 186:
arg 2 = '2'
arg 3 = '3'
 
==={{header|BaCon}}===
<lang freebasic>' Command line arguments including program name
PRINT "Entire command line: ", ARGUMENT$
 
SPLIT ARGUMENT$ BY " " TO cli$ SIZE args
PRINT "Skip program name:";
FOR i = 1 TO args - 1
PRINT " " & cli$[i];
NEXT
PRINT</lang>
 
{{out}}
<pre>prompt$ bacon command-line.bac
Converting 'command-line.bac'... done, 9 lines were processed in 0.002 seconds.
Compiling 'command-line.bac'... cc -c command-line.bac.c
cc -o command-line command-line.bac.o -lbacon -lm
Done, program 'command-line' ready.
 
prompt$ ./command-line -c "alpha beta" -h "gamma"
Entire command line: ./command-line -c "alpha beta" -h gamma
Skip program name: -c "alpha beta" -h gamma</pre>
 
=={{header|Batch File}}==
Anonymous user