Function calls
Provides a reference for the shorthand syntax used with function calls in OPL.
| Syntax | Shorthand for |
|---|---|
++X |
X = X+1 |
X++ |
Same as ++X, but returns the initial value
of X instead of its new value. |
--X |
X = X-1 |
X-- |
Same as --X, but returns the initial value
of X instead of its new value. |
X += Y |
X = X + Y |
X -= Y |
X = X - Y |
X *= Y |
X = X * Y |
X /= Y |
X = X / Y |
X %= Y |
X = X % Y |
X <<= Y |
X = X << Y |
X >>= Y |
X = X >> Y |
X >>>= Y |
X = X >>> Y |
X &= Y |
X = X & Y |
X ^= Y |
X = X ^ Y |
X |= Y |
X = X | Y |
| Syntax | Effect |
|---|---|
function (arg1, ..., argn) |
Calls Examples: parseInt(field) writeln("Hello ", name) doAction() str.substring(start, start+length)The function is typically either a script variable reference or a property access, but it can be any expression; the expression must yield a function value, or an error is signalled. Examples: callbacks[i](arg) // Calls the function in callbacks[i] "foo"() // Error: a string is not a function |