EXTRA

Extra variables are used to integrate ITP Model runs in applications. The name/value pair of the extra variable is passed to the model at the moment of model execution. This makes it possible to control the run of a model, for instance which part of the model must be executed, within the call to the model. In short; an EXTRA variable can be used to pass any value you need to a model at run time. If a name/value pair of an EXTRA variable is not included in the call to the ITP Model the end user will be asked to provide the value of the EXTRA variable during model execution.

Note

When EXTRA variables are omitted from a model call the model will become interactive. An interactive model, a model that asks for user input, cannot be used in ITP/Server. It can be used in ITP/OnLine Server and ITP/Workstation because they are designed to be interactive and EXTRAs are one way to ask for user input.

There are three kinds of EXTRAs - TEXT, NUMBER and BOOL- as can be seen in their declarations:

EXTRA TEXT name_variable 
LEN ( length )
DFT ( "standard value" )
PROMPT ( "prompt parameter" )
VALUES ( "value list" )
CHOICE ( "choice parameter" )

EXTRA NUMBER name_variable
LEN ( length )
DFT ( "standard value" )
PROMPT ( "prompt parameter" )
VALUES ( "value list" )
CHOICE ( "choice parameter" )

EXTRA BOOL name_variable 
PROMPT ( "prompt parameter" )
DFT ( "standard value" )

Note

The name of an EXTRA variable has to be all lowercase ( a to z, and all accented characters), numbers ( 0 to 9) and the "_"-character). The name of the variable cannot contain blanks. Instead of blanks you can use underscores.

Parameters

An EXTRA variable can have several parameters. The LEN parameter is required for an EXTRA variable of type TEXT or NUMBER; all other parameters are optional.

Which parameters you set depends on the use of the EXTRA. If, for instance, you want to use an EXTRA to interact with end users you can set the PROMPT (the question that will be asked) and either VALUES (if the choice is limited) or CHOICE (if the choice is not limited).

If on the other hand you are developing a model for ITP/Server interactivity is not an option and you will set the EXTRA type, name and LEN only.

Be aware that setting the DFT does not mean that the name/value pair of the EXTRA need not be passed. If you omit this pair the EXTRA will become interactive despite the presence of a DFT value. Something you might not want in an ITP/Server environment.

LEN

Required for EXTRAs of type TEXT or NUMBER.

When the EXTRA is of type TEXT, LEN stands for the permitted length in characters of the end users answer.

When the EXTRA is of type NUMBER, LEN stands for the total permitted length in digits of the end users answer – this is a number; 1 to 15. It is also possible to determine the number of decimal positions allowed within the returned number. A space must divide the two numbers.

Example

 EXTRA NUMBER name_variable
LEN ( 5 3 )

Please note the space between the two numbers. This will allow as an answer a number of 5 digits. Within this number, 3 decimal positions are allowed.

So, for instance, the answer can be:

12345 or 1234.5 or 123.45 or 12.345

Note

Instead of 'LEN ( length)' also '( length)' can be specified.

DFT

Optional.

The default value of the EXTRA.

What is allowed as a default value is determined by the type of the EXTRA as well as the LEN setting:

Example

EXTRA TEXT name_variable_text 
LEN ( 10 )
DFT ( "Johnson Al" )
EXTRA NUMBER name_variable_number
LEN ( 5 3 )
DFT ( "12.345" )
EXTRA BOOL name_variable_bool
DFT ("N")

Note

Please note the quotes around the DFT values; they are required. Also note that Johnson Al complies with the LEN setting of 10 and that 12.345
complies with the LEN setting of 5 3 .

Note

The DFT set must be part of the VALUES set, if VALUES are used.

Note

Setting the DFT will not prevent the model from becoming interactive when the EXTRA is not passed in the model call. This is important if the model is to be used in an ITP/Server environment.

PROMPT

Optional.

This parameter is of type TEXT; enclose its value in double quotes.

This is the question that will be presented to the end user if no value has been assigned to the variable before the execution of the model. If this parameter is not set the name of the EXTRA will be used as the question instead.

Example

EXTRA TEXT name_variable 
LEN ( 10 )
DFT ( "Johnson Al" )
PROMPT ("Select a customer:")
VALUES

Optional.

This parameter is of type TEXT; enclose its value in double quotes.

When set the end user is presented with a list of possible values from which a choice can be made.

VALUES must be set in different ways for the different types of EXTRAs:

Example

EXTRA TEXT name_variable 
LEN ( 10 )
DFT ( "Johnson Al" )
PROMPT ("Select a customer:")
VALUES ("'Johnson Al' 'Franklin A' 'Parker C' 'Biafra J'")

Note

The value set at DFT, if any, must be part of the list of values set with VALUES.

CHOICE

Optional.

This parameter is of type TEXT; enclose its value in double quotes.

The CHOICE parameter allows the end user to type in a value and it provides him with a list of possible values.

VALUES must be set in different ways for the different types of EXTRAs:

Example

EXTRA TEXT name_variable 
LEN ( 10 )
DFT ( "Johnson Al" )
PROMPT ("Select a customer:")
CHOICE ("'Johnson Al' 'Franklin A' 'Parker C' 'Biafra J'")
Use

As indicated the EXTRA variable can be used to interact with the end user in an ITP/Workstation or ITP/OnLine Server environment. In an ITP/Server environment however it can only be used to pass runtime information to the model and care must be taken to pass all EXTRAs to prevent the model from becoming interactive.

Another use of the EXTRA is during model development; it offers the possibility to pass dummy data to, parts of, the model. This allows you to debug, part of, the model.