Navigation: thinBasic Modules > OS (Operating System) > OS_GetCommands |
|
Description
Retrieve the number of commands specified in script command line.
Syntax
n = OS_GetCommands
Returns
Number.
Parameters
Name |
Type |
Optional |
Meaning |
Remarks
This command will always report as minimum value 1 because at position 1 OS_GetCommand will always return the full path of the script file.
Restrictions
Any of the following chars are used as default command separators: " =- (double quote, space, equal, minus). Use OS_CommandsSetSep function to set a different set of chars.
See also
Examples
USES "Console"
USES "OS"
Dim NumberOfCommands As Long
Dim Count As Long
'---Returns the number of commands specified
NumberOfCommands = OS_GetCommands
'---Some header
Console_Write("The following are the passed parameters (param 1 is always script name):" & $CRLF)
Console_Write(Repeat$(79, "-") & $CRLF)
'---Show all parameters
For Count = 0 To NumberOfCommands
console_Write( Format$(Count, "00") & " " & OS_GetCommand(Count) & $CRLF)
Next
© 2004-2008 thinBasic. All rights reserved. | Version 1.7.0.0 | Web Site: http://www.thinbasic.com |