coercion

The following tables shows how automatic coercion is applied to a general expression

RESULT   =   OPND1   op   OPND2
RESULT             OPND1             OPND2            
intintint
floatfloatfloat
stringstringstring
floatfloatint
floatintfloat
stringstringint
intintstring
stringstringfloat
floatfloatstring

explicit coercion between types

$valcoerce any value to string
int(val)coerce to integer any value of type
  • int
  • float
  • string
  • obj_id
  • ctl_id
float(val)coerce real any value of type
  • int
  • float
  • string

coercion of structures and arrays to strings

(packing structures and arrays into strings)
structures

tmp = pack(val)

format of packed string

{member1=value}{member2=value}{member3=value}{memberN=value}

where member is the name of the member within the structure

arrays

tmp = pack(val)

format of packed string

[value0][value1][value2][valueN]

where valueN is the value of element N of the arrays

A two dimensional array would be packed so:

[ [Jval0][Jval1][JvalN] ][ [Kval0][Kval1][KvalN] ][ [Lval0][Lval1][LvalN] ]

A structure within a structure would be packed so:

{Jmem1=value}{Jmem2={Kmem1=value}{Kmem2=value}{KmemN=value}}{Jmem3=value}{JmemN=value}

Arrays of structures

[ {J1=value}{J2=value}{JN=value} ][ {K1=value}{K2=value}{KN=value} ]

Structure containing an array

{member1=value}{member2=[value0][value1][value2][valueN]}{member3=value}{memberN=value}