The mgiIncrement Tag

Tag Behavior

Use the mgiIncrement tag to increment or decrement a numeric variable by a specified value.


Tag Syntax

The mgiIncrement tag has one required parameter and two optional parameters. The tag form is:

<mgiIncrement variableName="Name" scope="Scope" 
value="Number">

Required Parameters:

  • variableName - The variableName is the name of the variable to increment. If the variable has already been created, it must be blank or contain a number. If the variable has not been created, the mgiIncrement tag will create a new variable with the variableName and set the specified value.

Optional Parameters:

  • scope - The scope is the scope of the variable to increment. If the scope parameter is set to "page", then a page variable with the specified name will be incremented by the specified value. If the scope is set to "site", then a site variable with the specified name will be incremented by the specified value. The default scope is "page".
  • value - The value is amount to increment the variable. Use a negative number to decrement the value.


Example Usage and Output

<mgiIncrement variableName="Count" scope="Page" value="1">

In this example, a page variable is incremented by one. If the current value of the "Count" variable is "33", the mgiIncrement tag will set the value to "34" when it is processed.


Suggested Usage

  • Loops
  • Conditional Comparisons


[Understanding MGI Menu] [Using MGI Menu] [Referencing MGI Menu]


[MGI Guides Main Menu] [User Guide Main Menu]