8.8.14 ^= operator (power) (assign to a variable a variable raised to the power of an expression)
- Purpose
-
Raises a variable to the power of an expression, and assigns the result to the variable.
- Syntax
Result ^= Number
- Arguments
-
- Result
-
Specify a variable for storing the result.
- Number
-
Write any numerical expression.
- Description
-
The ^= operator raises the value of the variable Result by the power of the numerical expression Number, and assigns the result as an integer to Result.
Empty values are handled as zero. If Result is an Empty value or undefined, 0 is assigned to Result. If Number is an Empty value, the result is always 1 because the variable would be raised to the power of zero.
- Example
' This code stores 8 in variable result1. result1 = 2 result1 ^= 3
- JP1/Script version
-
Supported from JP1/Script 06-51.