DECVARIABLE

The DECVARIABLE function decrements the numeric value a flow variable.

This function defines a new flow variable if one doe not exist already and sets the specified decrement value as the initial value for the new flow variable. If the decrement value is not specified, it defaults to 1, and returns the set value in text format.

If the flow variable exists already and holds a numeric value, this function decrements by the specified increment value. If the decrement value is not specified, it decrements the numeric value associated to a flow variable by 1 and returns the set value in text format to the map. The value associated to a flow variable is non-numeric, then this function skips performing decrement operation on the value of the flow variable, leaves the non-numeric value intact.

Syntax:
DECVARIABLE ( single-text-expression [, single-text-expression] )
Meaning:
DECVARIABLE ( variable_name [, decrement_by] )
Returns:
A single text item.

Examples

  • flowlib->DECVARIABLE ( “interest.rate” )

    Decrements the value of flow variable, interest.rate, by 1 and returns the decremented value in text format. If the flow variable, interest.rate, does not exist already, creates one by that name, assigns 1 and returns “1”.

  • flowlib->DECVARIABLE “interest.rate”, 10 )

    Decrements the value of flow variable, interest.rate, by 10 and returns the decremented value in text format. If the flow variable, interest.rate, does not exist already, creates one by that name, assigns 10 and returns “10”.

  • flowlib->DECVARIABLE ( “city” )

    Returns empty value, if the flow variable, city, holds a non-numeric text value as ‘New York’. Decrement operation is not performed and retains the value of the flow variable intact as ‘New York’. If the flow variable, city, does not exist already, then a new flow variable, city, is created and set with value 1, returns “1” to the map.