6.6 Adding an integer decider
Whenever the XML allows an integer decider (instead of a concrete integer), these are the valid options:
- A binary operation calculation
- Other operations
- A concrete integer
To add an integer decider
- Locate the UI component that holds an integer (such as a number spinner). Determine which operation to use.
- Configure a binary operation.
- Set the <calculate> element with the binary-operation attribute set to the operation to be performed ("add" or "multiply").
- Set the <first> and <second> elements to components, integers, etc. These themselves could be deciders.
<calculate binary-operation="add">
<first>
<component id="disk" />
</first>
<second>60</second>
</calculate>
60 is added to the "disk" component. If the binary-operation were "multiply", the result would be the product of 60 and "disk".
- Configure other operations.
- Set the <calculate> element with the operation attribute set to "string-to-int".
- Set a child string decider for Viewpoint to evaluate and parse into an integer. See Adding a string decider.
Related topics