LassoScript Utility
Basics Browse Detail

-- Decrement

Tag Link -- Decrement Category Symbol
Type Symbol Source Available No
Support Preferred Version 5.0
Change Unchanged Data Source Any
Output Type Decimal or Integer Security None
Implementation LCAPI Sets Lasso 8.5, Lasso 8.0, Lasso 7.0, Lasso 6.0, Lasso 5.0

Description

-- decrements the value of the right parameter by one and returns the result. If the right parameter is a variable then the result is stored in the variable.

The result will be either an integer or a decimal value depending on the type of the right parameter. This symbol cannot be used with string values.

Syntax

[Output: --Right_Parameter]

<?LassoScript
Output: --Right_Parameter;
?>

[--Right_Parameter]

<?LassoScript
--Right_Parameter;
?>

Parameters

Required Parameters
Right_Parameter The variable or value which should be decremented by one.

Examples

To display the values from 10 down to 1:

Use the [Loop] ... [/Loop] tags and a decremented variable. The following code initializes a variable to 11, then decrements it once on each loop, displaying the results.

[Variable: 'Result'=11]
[Loop: 10]
  [Output: --$Result]
[/Loop]

10 9 8 7 6 5 4 3 2 1