Subtract Action

image\Action_Variable_Subtract.jpg

The Subtract action allows you to subtract a specified number or the number contained in a different variable from the contents of a variable.

Note:
The other basic math actions available are: Add, Multiply and Divide. For more complex mathematical functions use the OpusScript language.

Setting up the Subtract action:

1. Add the Subtract action to your trigger, as described in adding actions. The Subtract tab will automatically appear when you add the action.

2. Use the Number option in the Subtract panel to subtract a number from the value of the variable entered in the Variable box of the From panel (see point 3 below). Use the spin buttons to set a specific number. By default this option is selected.

Note:
By default, the number 1 is in this box. This action is normally used to decrement a variable by one, for example; every time a user answers a question incorrectly you might want to subtract a point from their score.

3. Use the Variable option in the Subtract panel to select the name of a variable in the current publication whose value you want to subtract from the variable entered in the Variable box of the From panel (see point 3 below). Click on the down arrow to the right of the Variable box to list all of the variables in the current publication. Alternative, click on the New Variable… button to open the New Variable dialog box in which you can create a new variable.

Note:
The value of the variable you select here should only contain a number.

4. Use the Variable option in the From panel to select the name of the variable from which the number will be subtracted. Click on the down arrow to the right of the Variable box to list all of the variables in the current publication. Alternative, click on the New Variable… button to open the New Variable dialog box in which you can create a new variable.

5. Click on the Apply button to save your changes.

Related Topics:

Introducing the Variables Actions

Choosing an Action