26.12.2012 Views

ICAM Virtual Machine V19 - Kxcad.net

ICAM Virtual Machine V19 - Kxcad.net

ICAM Virtual Machine V19 - Kxcad.net

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Operators<br />

Numeric, String and Sequence Operators<br />

<strong>Virtual</strong> <strong>Machine</strong> Reference, Model Customization<br />

The Macro Language, Fundamentals of the Macro Language<br />

The following table summarizes the numeric, string and sequence operators available in the<br />

macro language in decreasing order of precedence. You cannot use numeric operators on strings,<br />

nor can you use the string operator on numbers.<br />

Operator Function Example<br />

** Exponentiation $P3**2<br />

/ Division $PI/2<br />

* Multiplication 3.5*$P1<br />

+ Addition %G00+%L00<br />

- Subtraction %G00-3<br />

: Sub-string/sequence $P2(1:3)<br />

// String concatenation 'PART'//%L02<br />

( ) Group %L01/(%L02+4)<br />

{ } Sequence {$XC,$YC,$ZC}<br />

A series of exponentiation operations are evaluated from right to the left. The following are<br />

equivalent:<br />

a**b**c<br />

a**(b**c)<br />

The multiplication and division operators have the same level of precedence. A series of<br />

multiplications and/or divisions are evaluated from left to right. The following are equivalent:<br />

a*b/c<br />

(a*b)/c<br />

The addition and subtraction operators similarly have the same level of precedence and are<br />

evaluated from left to right. The following are equivalent:<br />

a+b-c<br />

(a+b)-c<br />

Putting the numeric operators together, the following are equivalent:<br />

a+b**c/d<br />

a+((b**c)/d)<br />

The substring/subsequence operator is used as “variable(start:end)” to return a range of characters<br />

instead of a single character of the named string variable, or to return a range of elements<br />

instead of a single element in the named sequence variable. It is important to note that the<br />

<strong>ICAM</strong> Technologies Corporation – Proprietary 129

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!