Was this helpful?
Using Application-specific Parameters
When users run an imaged application from the command line, you can let them specify parameter values that are passed back to the application itself. For example, you can ask the user to indicate a department name when starting the application. You then can use this value to restrict the records that the user can see on a Browse frame.
The -a flag indicates the start of a string of application-specific parameters. You retrieve the values into the application with the CommandLineParameters() function. Because of the way in which the CommandLineParameters() function retrieves the parameter values, the -a flag must be the last flag on the command line. You must leave a blank space between the -a flag and the first parameter that follows it.
You can write escape code (for example, Form-Start escape code for the top frame) to define in the application as many variables as you need to hold the values that the user specifies. You then can use these variables throughout the application, in any of the following ways:
In escape code
As parameters passed to a Vision frame
As part of a visual query for an Append, Browse, or Update frame (for example, in a query restriction)
If you want to use multiple parameters, be aware that the CommandLineParameters() function always returns a single value—all the parameters concatenated into a single string, with the parameters separated by a single space (any multiple spaces that the user enters are compressed). You must write your own code for parsing this value into the separate variables for your application to use.
For an example of 4GL string-parsing code, and more information about how the CommandLineParameters() function retrieves parameter values, see the 4GL reference part of this guide.
Last modified date: 12/14/2023