A variable is a symbolic name for a value.
Port Variables
The values of the port structure are referenced as port variables within a component. There are automatic port variables for both input ports and output ports. Port variables are valid within the component, and they inherit the name and datatype of the port structure. The name of the variable is prefixed with "IN." for the input ports and "OUT." for the output ports. input port variables are read-only, but output port variables can be written.
This example uses port variables in an expression:
uUpper(IN.CU_NAME)
OUT.CU_NAME = uUpper(IN.CU_NAME);
Component Variables
uIsNull(REF.Host)
To provide flexibility in transformations, all port and component variables internally use the datatype string. If you use numeric values, this may result in unexpected behavior.
If multiplied by 1, the numeric value of a string variable is used in a calculation:
IN.Margin="2", IN.Price="10" IN.Margin>IN.Price - returns TRUE
IN.Margin*1>IN.Price*1 - returns FALSE
Do not use reserved JavaScript keywords for port and component variable names:
Reserved JavaScript Keywords |
||||
---|---|---|---|---|
break |
case |
catch |
continue |
default |
delete |
do |
else |
finally |
for |
function |
if |
in |
instanceof |
new |
return |
switch |
this |
throw |
try |
typeof |
var |
void |
while |
with |
abstract |
boolean |
byte |
char |
class |
const |
debugger |
double |
enum |
export |
extends |
final |
float |
goto |
implements |
import |
int |
interface |
long |
native |
package |
private |
protected |
public |
short |
static |
super |
synchronized |
throws |
transient |
volatile |
const |
export |