LassoScript Utility
Basics Browse Detail

%= Modulo Assignment

Tag Link %= Modulo Assignment Category Symbol
Type Symbol Source Available No
Support Preferred Version 5.0
Change Unchanged Data Source Any
Output Type None Security None
Implementation LCAPI Sets Lasso 8.5, Lasso 8.0, Lasso 7.0, Lasso 6.0, Lasso 5.0

Description

%= calculates the value of the left parameter modulo to the value of the right parameter and sets the left parameter to the resulting value. The left parameter should be a variable that contains an integer value. The right parameter must also be an integer.

This symbol does not operate on string values.

Syntax

[(Variable: 'Left_Parameter') %= Right_Parameter]

<?LassoScript
(Variable: 'Left_Parameter') %= Right_Parameter;
?>

<?LassoScript
$Left_Parameter %= Right_Parameter;
?>

Parameters

Required Parameters
Left_Parameter The variable in which the value should be stored.
Right_Parameter The modulus of the calculation.

Examples

To calculate the modulo of a variable:

Use the modulo assignment symbol %=. The modulo of the variable will be calculated and stored in the variable. No result will be returned to the format file. The following example calculates the value of a variable Result modulo 5. The value of the variable is then displayed.

<?LassoScript
  Variable: 'Result'=10;
  $Result %= 5;
  Output: $Result;
?>

0