Omni Systems, Inc.

  

Mif2Go User's Guide, Version 55

  

Valid HTML 4.01!

 

Made with Mif2Go

28 Working with macros > 28.6 Using expressions in macros > 28.6.1 Understanding macro expressions


28.6.1 Understanding macro expressions

Result is a string value

An expression always generates a string value, which for some purposes can be treated as a decimal integer number (or a hexadecimal number, depending on the operands); that is, you can do arithmetic on the result.

Decimal vs. hexadecimal

The numeric result of an expression is decimal by default, unless the left operand is in hexadecimal format; then the result is in hexadecimal. You can coerce output to the other base by adding zero as the first term, expressed in the desired base, to the left operand. For example, you can coerce output to decimal with (0 + 0x30), which yields 48; or to hexadecimal with (0x0 + 31), to get 0x1F.

Mif2Go does not support octal numbers or floating-point numbers.

Anonymous expressions

Where you want to use the result of an expression, but you do not need to store the result for later use, you can use “anonymous” expressions; for example:

<$($$_count + 2)>



28 Working with macros > 28.6 Using expressions in macros > 28.6.1 Understanding macro expressions