Increment Variable

Declaration

<AMINCREMENTVARIABLE RESULTVARIABLE="text (variable name)" AMOUNT="number" />

Example

This example Increments the specified variable's initial value of 0 by 10 during each loop.

<AMVARIABLE NAME="thecounter">0</AMVARIABLE>

<AMLOOP TOTALLOOPS="10">

<AMINCREMENTVARIABLE RESULTVARIABLE="thecounter" AMOUNT="10" />

<AMSHOWDIALOG WINDOWTITLE="CURRENT VALUE">Current Value is %thecounter%.</AMSHOWDIALOG>

</AMLOOP>

See Also

Create Array, Create Object, Create Variable, Decrement Variable, Define Type, ReDim Array, Set Variable

Increments a variable by the specified amount. The variable must contain a valid number. If the variable is blank, zero is assumed.

Used to increase the value of a "counter" variable. Normally, counters are used inside of a loop.

To enter Increment Variable properties

  1. In the Available Actions pane, open the Variables folder and double-click the Increment Variable action or drag it into the Steps pane.

  2. In the Variable Name box, select the variable to increment.

  3. In the Increment by box, enter the amount by which to increase the variable. If the variable is blank when the increment step runs, zero value is assumed. If you want to use an expression, click the percent sign (%) and use the Expression Builder to create it.

  4. To set the Description tab properties, refer to Description Tab Options.

  5. To set the Error Causes and On Error tab properties, refer to Step Error Handling.

  6. When finished, click OK to save settings and close the properties dialog box.

General Tab

Property

Type

Required

Default

Markup

Description

Variable to increment

Text

Yes

(Empty)

RESULTVARIABLE="thecurrentdate"

The name of the variable to increment.

Amount

Text

No

1

AMOUNT="5"

The value that the variable should be increased by.

Using Variables

All variables must be created before they can be used. This is done using the Create Variable action. Once created, variables can be set using the Set Variable action, or by certain actions that support populating variables. To get data out of the variables in any action parameter, surround the variable name with percentage % signs (i.e. %varname%). Remember not to use percentage signs when specifying the name of a variable to populate, percentage signs are only needed to get data out.

See Also

About Actions

Adding Task Steps

About Variables