Home | Sign in | English EN

WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WindowsLinuxPHPWEBDEV - Browser code
AndroidAndroid Widget iPhone/iPadApple WatchUniversal Windows 10 AppWindows Mobile
Stored procedures
CommandLine (Function)
In french: LigneCommande
Identifies and retrieves the different elements of the command line passed as a parameter to the current program.
// The executable is called by the following command line:
// project.exe param1 /opt1=param2 "param31 param32" -opt2="param41 param42"
CommandLine() // Returns the entire command line
CommandLine(1) // Returns 'param1'
CommandLine(2) // Returns '/opt1 = param2'
CommandLine(3) // Returns 'param31 param32'
CommandLine(4) // Returns '-opt2 = "param41 param42"'
CommandLine(5) // Returns ' '
CommandLine("opt1") // Returns 'param2'
CommandLine("opt2") // Returns 'param41 param42'
CommandLine("opt3") // Returns ' '
CommandLine("opt3", "Empty") // Returns 'Empty'
Reports and QueriesJavaUser code (UMC)

Retrieving the entire command line Hide the details

<Result> = CommandLine()
<Result>: Character string
Command line passed to the executable (without the name of the executable itself).

Retrieving the value of Nth parameter in the command line Hide the details

<Result> = CommandLine(<Option subscript>)
<Result>: Character string
Parameter corresponding to the requested subscript.
<Option subscript>: Integer
Subscript of option to retrieve.
Remark: The space character corresponds to the separator.

Retrieving the value of a specific parameter in the command line Hide the details

<Result> = CommandLine(<Option name> , <Default value>)
<Result>: Character string
Value corresponding to the requested parameter.
<Option name>: Character string (with quotes)
Name of option to retrieve. The following syntaxes are accepted:
  • /<name> = value
  • -<name> = value
The space character corresponds to the separator. To use a space in the value of a named parameter, the parameter must be enclosed in quotes ("<Parameter with space>").
Example: project.exe param1 /opt1="param2 with spaces".
<Default value>: Character string (with quotes)
Default value returned if the option is not found or does not exist.
By default, the returned value by is an empty string ("").
CommandLine("select", "False")
  • program.exe -> CommandLine returns "False".
  • program.exe /select -> CommandLine returns "False".
  • program.exe /select=abc -> CommandLine returns "abc".
  • In test mode, you can specify the command line in the editor (on the "Project" pane, in the "Test mode" group, expand "Test mode" and select "Configure test mode").
  • Unlike CommandLine, dbgStandardOutput allows the executable to return a value to the application that started it (write operation in STDOUT).
Business / UI classification: Neutral code
Component: wd260vm.dll
Minimum version required
  • Version 9
This page is also available for…
Click [Add] to post a comment