5.3.4 Assignment operators
The assignment operators are used to assign values to variables. They can assign the results of arithmetic operations and bitwise logical operations on variables. The following table lists and describes the assignment operators supported by JP1/Advanced Shell.
Assignment operator |
Description |
---|---|
num1=num2 |
Assigns num2 to num1. |
num1*=num2 |
Assigns to num1 the result obtained by multiplying num1 by num2. |
num1/=num2 |
Assigns to num1 the result obtained by dividing num1 by num2. |
num1%=num2 |
Assigns to num1 the remainder obtained by dividing num1 by num2. |
num1+=num2 |
Assigns to num1 the result obtained by adding num1 and num2. |
num1-=num2 |
Assigns to num1 the result obtained by subtracting num2 from num1. |
num1<<=num2 |
Assigns to num1 the result obtained by shifting num1 to the left by num2 bits. |
num1>>=num2 |
Assigns to num1 the result obtained by shifting num1 to the right by num2 bits. |
num1&=num2 |
Assigns to num1 the result obtained by performing bitwise AND operation on num1 and num2. |
num1|=num2 |
Assigns to num1 the result obtained by performing bitwise OR operation on num1 and num2. |
num1^=num2 |
Assigns to num1 the result obtained by performing bitwise EXCLUSIVE-OR operation on num1 and num2. |