Parameter Type name;
Parameter Type name = default;
Note
A parameter is always required, unless it has a default value. So the first is a required parameter, the second one optional.
A script that calls another script may specify parameters as key(value) pairs. Optional parameters can be omitted. In other words: scripts are called in the same way as predefined commands.
Example:
Here the script RunITP is called as a command, note the parameters:
RunITP
Model("c:\itpwork\models\example.itp")
Result("c:\tmp\output.doc")
Options("/qim");
This shows the parameters as declared in the script RunITP:
Parameter Text Model;
Parameter Text Result;
Parameter Text Options = "/qi";
Parameter text Configuration = "c:\itpwork\config.141\itp.cfg";
The parameters Model and Result are required. These must be specified in the call.
The parameters Options and Configuration are optional. The call will override the Options default of "/qi" with the (Options("/qim") value, furthermore the default for the parameter Configuration is used because the parameter Configuration is not present in the call.
ITP/Server passes the parameters in a job request to the corresponding Service script in the order they are listed in the job request. These than need to be mapped to the script parameters known by their name. This is done on the tab Service of a Service in the ITP/Server Administrator. As described in Three: map the parameters above. See also the example below.
This mapping will appear in the dp.ini file of the ITP/Server folder ITPWORK\Config.
Evaluation of expressions takes place as follows:
- The expression $0 is replaced by the job name as specified in the request. In other words, each call must start with the name of the service required.
- Each expression $n is replaced by the nth parameter that is specified in the call. If the call does not have an nth parameter the value of the expression becomes empty.
- Other expressions are passed unmodified.*
If an expression passed, i.e. the actual value passed in the job request, evaluates to an empty value, ITP/Server will treat the corresponding parameter as undefined, i.e. as if it has not been provided to the script. This will result in an error if the parameter is required.
Note
It is possible to set a value instead of an sequence number on the tab Service of the Service. This might be convenient to set, for instance, a temp directory from outside the script.
Example

In this screen shot the parameters as defined in the script of the mainexample service are mapped to the call parameters. script_parameter1 is expected first, followed by script_parameter2. Note that in the call itself these are preceded by the name of the service, in this case, "mainexample".
The script parameter tempdir, however, is not mapped but set to a fixed value: c:\temp. In this way the script can be made more versatile, it can be set to use any temp dir, while at the same time the location of the temp dir need not be passed with every call to the service. The setting of the temp dir has been made external yet fixed.
Automatic Type Conversions
ITP/Server will convert expressions when processing parameters passed by a client.
From/To |
Numbers |
Booleans |
Strings |
String is interpreted as a number. Non-numeric values cause a runtime error. |
"Y" and "True" are converted to True. "N" and "False" are converted to False. All other values cause a runtime error. |