INTEGER expressions return integers (whole numbers). INTEGER expressions can be used to combine expressions, do arithmetic, and test conditions for conditional evaluation. The INTEGER MATH expression can perform a variety of operations on two values, including arithmetic, Boolean tests, and string comparison.

Although the returned value is always an integer, the operation itself can be performed using a variety of data types. A TYPE expression node tells the MATH expression what type to convert its sub-expressions into prior to performing the operation. The operation to be performed is supplied in an OPERATOR expression node; the values to be operated on are supplied in two sub-expressions.

In the TYPE expression node, the VALUE attribute has the following supported values:

The following OPERATOR expression node require that the TYPE attribute of their sub-expressions have a value of either INTEGER or FLOAT:

The following OPERATOR expression nodes require that the TYPE attribute of their two sub-expressions have a value of INTEGER, FLOAT, or STRING.

The following OPERATOR expression nodes require that the TYPE attribute of their two sub-expressions have a value of STRING:

In the OPERATOR expression nodes, the following two values of the VALUE attribute have slightly different behavior for STRING than for INTEGER:

See the EXPRESSION element for DTD and attribute information.

This example illustrates the use of an OR in the OPERATOR expression node. The example reads: If Category equals "A" or Category equals "B", then create a new instance of the property "ABCompanies" with the value from the Company property. The syntax implicitly selects the first value of a given property if the property is multi-assigned. "IDENTITY" gets the actual value of the property, while "CONST" is a literal.

<EXPRESSION LABEL="" NAME="IF" TYPE="VOID" URL="">
  <EXPRESSION LABEL="" NAME="MATH" TYPE="INTEGER" URL="">
    <EXPRNODE NAME="TYPE" VALUE="INTEGER"/>
    <EXPRNODE NAME="OPERATOR" VALUE="OR"/>
    <EXPRESSION LABEL="" NAME="MATH" TYPE="INTEGER" URL="">
      <EXPRNODE NAME="TYPE" VALUE="STRING"/>
      <EXPRNODE NAME="OPERATOR" VALUE="EQUAL"/>
      <EXPRESSION LABEL="" NAME="IDENTITY" TYPE="PROPERTY" URL="">
        <EXPRNODE NAME="PROP_NAME" VALUE="Category"/>
      </EXPRESSION>
      <EXPRESSION LABEL="" NAME="CONST" TYPE="STRING" URL="">
        <EXPRNODE NAME="VALUE" VALUE="A"/>
      </EXPRESSION>
    </EXPRESSION>
    <EXPRESSION LABEL="" NAME="MATH" TYPE="INTEGER" URL="">
      <EXPRNODE NAME="TYPE" VALUE="STRING"/>
      <EXPRNODE NAME="OPERATOR" VALUE="EQUAL"/>
      <EXPRESSION LABEL="" NAME="IDENTITY" TYPE="PROPERTY" URL="">
        <EXPRNODE NAME="PROP_NAME" VALUE="Category"/>
      </EXPRESSION>
      <EXPRESSION LABEL="" NAME="CONST" TYPE="STRING" URL="">
        <EXPRNODE NAME="VALUE" VALUE="B"/>
      </EXPRESSION>
    </EXPRESSION>
  </EXPRESSION>
  <EXPRESSION LABEL="" NAME="CREATE" TYPE="VOID" URL="">
    <EXPRNODE NAME="PROP_NAME" VALUE="ABCompanies"/>
    <EXPRESSION LABEL="" NAME="IDENTITY" TYPE="PROPERTY" URL="">
      <EXPRNODE NAME="PROP_NAME" VALUE="Company"/>
    </EXPRESSION>
  </EXPRESSION>
</EXPRESSION>


Copyright © Legal Notices