Unit operators allow entry and conversion of real-world units such as lengths, money & time. See the Operators listing.
Arithmetic operators perform basic mathematical operations such as addition, subtraction, or multiplication; combine numbers; and produce numeric results. You can either use the mathematical symbol (e.g. + or -) or you can use a keyword (e.g. TIMES).
Arithmetic Operator Meaning Example + or PLUS Addition or Positive 3 + 3 or +8 - or MINUS or LESS Subtraction or Negation 3 - 1 or -17 * (asterisk) or TIMES Multiplication 3 * 7 / (fwd slash) or DIVIDED BY Division 8 / 2 % (percent sign) Percent 20% ^ (caret) Exponentiation 3 ^ 2
Comparison operators compare two values and then produce the logical value TRUE or FALSE. You can use the symbols ( =, <, etc) or the text phrases.
All of the key phases can have a 'NOT' inserted after the 'IS' to return the opposite result, e.g. 'IS AT LEAST' and 'IS NOT AT LEAST'. A special case is the 'IS BETWEEN' comparison, when a number is compared to two other values (instead of just one). The EXCLUSIVE word is optional, and the default (INCLUSIVE) is used if it is left out.
If you want to ensure numeric comparisons takes place with the operators > >= < <= (i.e. to force numeric, not string behaviour), use a minus operator and compare the difference to 0, for example...
if FinishedSize.y - FinishedSize.x > 0 then Point[1].x else 0For string comparisons, "80mm" > "125mm" is true, whereas numeric conversion to length gives 80mm > 125mm which is false. A subtraction forces numeric behaviour, with 80mm - 125mm > 0 comparing -45mm > 0 and giving the result false. This is only applicable to machinestep entry cells which are not strongly typed so they are string cells. In other places, like friendly pages and built in page cells carrying lengths, this concern does not apply.
Comparison Operator Meaning Example = or == or IS or IS EQUAL TO Equal to A == B > or IS GREATER THAN or IS MORE THAN Greater than A > B < or IS LESS THAN or IS FEWER THAN Less than A < B >= IS AT LEAST or IS NOT LESS THAN etc More than or equal to A >= B <= IS AT MOST or IS NOT MORE THAN etc Less than or equal to A <= B <> or != or IS NOT or IS NOT EQUAL TO Not equal to A != B IS BETWEEN x AND y [EXCLUSIVE] Between two values A is between B and C
The text operator '&' combine one or more text values to produce a single piece of text.
Text Operator Meaning Example & (ampersand) Joins two strings "North" & "wind" = "Northwind" If you mix text and numeric values, then '&' and '+' behave differently; '+' will attempt convert the text to a number and add it, '&' will convert the numeric to text and then concatenate (join) them.
The scope operator '.' (full stop) returns a property of another object.
Scope Operator Meaning Example . (period) A property of another section Container.Width
The array subscript operator '[ ]' (square brackets) returns a value from an array (see Arrays).
Array Operator Meaning Example [ ] (square brackets) Returns a value from an array Dim[1]
If you combine several operators in a single formula, CabMasterPro performs the operations in the order shown in the following table. If a formula contains operators with the same precedence (for example, if a formula contains both a multiplication and division operator) CabMasterPro evaluates the operators from left to right. To change the order of evaluation, enclose in parentheses the part of the formula you want to calculate first.
Operator | Examples |
---|---|
Units | $ m deg minutes ft |
Array element | [ ] |
Scope | . (full stop) |
Negative and Positive | + - |
Percent | % |
Exponentials | ^ |
Multiplication and Division | * / |
Addition and Subtraction | + - |
Concatenation (text addition) | & + |
Comparison | <= > == |