The expression evaluator automatically coerces variables in mixed-type expressions. If the result of an expression is not what is expected because of automatic coercion, use of the coercion operators in some cases yields the desired result. Following are examples of automatic coercions in mixed-type expressions.
"CIR" + 1
Evaluates to "CIR1"
"2" + 2
Evaluates to 4
"The Value of 2+2 is "
+ 2 + 2
Evaluates to "The Value of 2+2 is 22". This is because PC-DMIS
evaluates expressions left to right, and the left part of the expression
is a string.
"The Value of 2+2 is "
+ (2 + 2)
Evaluates to "The Value of 2+2 is 4"
LINE1.XYZ > 2
Evaluates to 1 if the distance of the centroid of LINE1 from the origin
is greater than 2
LINE1.XYZ > LINE2.XYZ
Evaluates to 1 if the centroid of LINE1 is further from the origin than
the centroid of LINE2
LINE1.XYZ = LINE2.XYZ
Evaluates to 1 if the centroids of LINE1 and LINE2 are the same (no coercion
occurs in this case)
DOUBLE(LINE1.XYZ) = DOUBLE(LINE2.XYZ)
Evaluates to 1 if the centroids are the same distance from the origin
11% 3.1
Evaluates to 2 (% is the modulo operator designed to work with integers.
It returns the remainder from discrete division. 11%3 = 2.)
CIRCLE1.HIT [3.2].X
Evaluates to measured X value of third hit of Circle1. The argument 3.2
is automatically coerced to an integer with a value of 3.