User Tools

Site Tools


en:variableoperators

Variable Operators

Most operators work with one or two expressions (integers, floating point numbers, strings, and Boolean values), but there are a few operators that work specifically with variables, arrays, and array elements. These operators will directly change the value stored in a variable.

Variable Operators
OperatorNameExampleComments
=Assign a Number to a Variablea = 9
z = “Hola.”
q$ = 9.9
+=Add to a Variablea += 7Same as a = a + 7
Concatenate to a Variablef += “.”Same as f = f + “.”
-=Subtract from a Variablea -= 9Same as a = a - 9
*=Multiply a Variablea *= 2Same as a = a * 2
/=Divide a Variablea /= 8Same as a = a / 8
++Increment Prefix++aIncrement (add one) the the variable and return the value after the increment. (may be applied ONLY to numeric variables or array elements)
++Increment Suffixa++Return the value of the variable and then increment the variable by one for the next time it is accessed. (may be applied ONLY to numeric variables or array elements)
Decrement Prefix–aDecrement (subtract one) the variable and return the value after the decrement. (may be applied ONLY to numeric variables or array elements)
Decrement Suffixa–Return the value of the variable and then decrement the variable by one for the next time it is accessed. (may be applied ONLY to numeric variables or array elements)
fillArray Filla fill 99Fills an array (that was previously dimensioned) with a single value (may be a string or numeric expression)
en/variableoperators.txt · Last modified: 2016/08/17 12:02 by admin