LassoScript Utility
Basics Browse Detail

+= Addition Assignment

Tag Link += Addition 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

+= adds the value of the right parameter to the value of the left parameter and sets the left parameter to the resulting value. The left parameter should be a variable that contains a string, decimal, or integer value.

This symbol performs mathematical addition if both parameters contain decimal or integer values. The result will be a decimal if either parameter is a decimal value.

This symbol performs string concatenation if either parameter is a string. The result is the left parameter followed by the right parameter.

Note: If the parameter on the right hand side of the symbol is a negative literal it should be surrounded by parentheses. For example, ($var += (-1)).

Syntax

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

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

<?LassoScript
$Left_Parameter += Right_Parameter;
?>

Parameters

Required Parameters
Left_Parameter The variable to which the value should be added.
Optional Parameters
Right_Parameter The value to be added.

Examples

To add a value to a variable:

Use the addition assignment symbol +=. The value will be added to the variable and no result will be returned to the format file. The following example adds 5 to the variable Result. The value of the variable is then displayed.

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

15