{{DISPLAYTITLE:_COMMANDCOUNT}}
The [[_COMMANDCOUNT]] function returns the number or arguments passed from the command line to the [[COMMAND$]] function.


{{PageSyntax}}
:::''result&amp;'' = [[_COMMANDCOUNT]]


{{PageDescription}}
* The function returns the number of arguments passed from the command line to a program when it's executed.  
* Arguments are spaced as separate numerical or text values. Spaced text inside of quotes is considered as one argument. 
* In c, this function would generally be regarded as 'argc' when the main program is defined as the following:  int main(int argc, char *argv[])


''Example:'' The code below gets the number of parameters passed to our program from the command line with _COMMANDCOUNT: 
{{CodeStart}}limit = {{Cl|_COMMANDCOUNT}}
{{Cl|FOR...NEXT|FOR}} i = 1 {{Cl|TO}} limit
    {{Cl|PRINT}} {{Cl|COMMAND$}}(i)
{{Cl|NEXT}}
{{CodeEnd}}
: ''Explanation:'' If we start ''ThisProgram.exe'' from the command window with '''ThisProgram -l &quot;loadfile.txt&quot; -s &quot;savefile.txt&quot;''', the _COMMANDCOUNT would be 4, &quot;-l&quot;, &quot;loadfile.txt&quot;, &quot;-s&quot;, &quot;savefile.txt&quot; command arguments passed to the program, which we could then read separately with COMMAND$(n).


{{PageSeeAlso}}
* [[COMMAND$]]
* [[SHELL]]


{{PageNavigation}}