Including variables

A variable is a symbolic name for a value. There are two basic properties of a variable:

The scope of a variable decides in which scope of the environment the variable can be referenced.

There are:

Port variables

The values of the port structure are referenced as Port variables within a component. There are automatic Port variables for both IN-Port and OUT-Port. Port variables are valid within the component and they inherit the name and datatype of the port structure. The name of the variable is either prefixed with IN. for the IN-Ports or OUT. for the OUT-Ports. IN-Port variables are read-only, OUT-Port variables can be written. The following example uses PORT variables in an expression:

uUpper(IN.CU_NAME)Using PORT variables in a procedure:OUT.CU_NAME = uUpper(IN.CU_NAME);

Component variables

Component variables are created in the Property section of the component and can be referenced inside the component. The Component Variable is only valid inside the component. The name of the variable is prefixed by REF, for example:

uIsNull(REF.myvariable)

NoteTo provide high flexibility in transformations, all port and component variables internally use the datatype “string”. This may result in unexpected behavior when using numeric values. If multiplied by 1, the numeric value of a string variable will be used in a calculation:

IN.Margin="2", IN.Price="10"
IN.Margin>IN.Price  - returns TRUE
To enforce a numeric comparison use
IN.Margin*1>IN.Price*1  - returns
FALSE