
Online Scripting Reference


multiply
Purpose

Performs mathematical multiplication on a variable.

Syntax

multiply var {value}
var: The variable to be multiplied.
{value}: The amount to multiply the variable by.

Notes

This command is used internally by the compiler to perform multiplication. It can also be called manually.
Another way to perform multiplication is like this:
setVar $value ($value * 50)

Example

# calculate exactly how many trips we're making
# and how much we're carrying on our last trip
setVar $trips $quantity
divide $trips $holds
setVar $x $trips
multiply $x $holds
setVar $lastTrip $quantity
subtract $lastTrip $x
if ($lastTrip = 0)
setVar $lastTrip $holds
else
add $trips 1
end

Return to item listing 

