Zum Hauptinhalt springen

Type Conversion and Assignment

Assignment Model​

The way iXML assigns values depends on the type:

  • Primitive variables (null, bool, int, float, string) are assigned by value. Copies are created.
  • Complex variables (array, function, macro, class) are assigned by reference. Both variables point to the same data.

Type Conversion Table​

The following table shows how values behave across type inspection, comparison, and casting.

ValueTYPEOFIF=''IF!=''IF='0'CAST(bool)CAST(int)CAST(float)CAST(string)
<undefined>'undefined'truefalsefalsefalse00''
NULL'null'truefalsefalsefalse00''
TRUE'bool'falsetruefalsetrue11'1'
FALSE'bool'truefalsefalsefalse00''
0'int'falsetruetruefalse00'0'
123'int'falsetruefalsetrue123123'123'
0.0'float'falsetruetruefalse00'0'
'0''string'falsetruetruefalse00'0'
'abc''string'falsetruefalsetrue00'abc'
'''string'truefalsefalsefalse00''
<array>'array'falsetruefalsetrue00'[array#N]'
warning

Numeric Comparison Trap: <if value1="0" func="=" value2="0.0"> is true because numeric comparison is performed when both sides look numeric.