Runtime.GetCommandLineParameter

Prototypes

static String GetCommandLineParameter( String sName )

Return Value

If the specified command-line parameter is defined, the return value is a reference to a String object containing the parameter's value. If the specified command-line parameter is not defined, the return value is a reference to an empty String object. If you assign the return value to a matrix, you can use the NLENG function to determine whether the parameter is defined:

value = Runtime.GetCommandLineParameter( "name" );
if nleng(value) = 0 then
    print "Not defined";
else
    print "Defined";
Parameters

String sName
The name of the command-line parameter to retrieve. The name is not case sensitive.

Remarks

This method returns the value of a parameter defined on the command line used to launch IML Studio. If the parameter is defined more than once, this method returns the value of the last definition.

Command-line parameters are used in conjunction with the IMLPlus batch driver program IMLPlus.exe. Command-line parameters enable you to pass information to an IMLPlus program that runs in batch mode. For further information about command-line parameters, please refer to the topic Passing Information to Programs in Batch Mode.

Example

Suppose the file Example.sx contains the following IMLPlus program:

declare DataObject dobj;
dataset = Runtime.GetCommandLineParameter( "DataSet" );
dobj = DataObject.CreateFromFile( dataset );
xvar = Runtime.GetCommandLineParameter( "X" );
yvar = Runtime.GetCommandLineParameter( "Y" );
declare ScatterPlot plot;
plot = ScatterPlot.Create( dobj, xvar, yvar );
PlotFileName = Runtime.GetCommandLineParameter( "PlotFileName" );
plot.SaveToFile( PlotFileName, 800, 533 );

The following Windows command line will run the program and create the bitmap graphics file Example.bmp:

imlplus Example.sx -d dataset=baseball -d x=no_hits -d y=no_runs -d plotfilename=Example.bmp