Special operators
Lists the special operators in OPL and their syntax.
| Syntax | Effect |
|---|---|
new constructor(arg1, ..., argn) |
Calls the constructor with the given arguments, and returns the created value. Examples: new Array() new MyCar("Ford", 1975)The constructor is typically a script variable reference, but it can be any expression. Example: new ctors[i](arg) // Invokes constructor ctors[i] |
typeof value |
Returns a string representing the type of value, as follows: Array "object" Boolean "boolean" Date "date" Function "function" Null "object" Number "number" Object "object" String "string" Undefined "undefined" |
delete variable |
Deletes the global script variable Example: myVar = "Hello, world" // Create the global variable myVar delete myVar writeln(myVar) // Signals an error because myVar is undefinedIf The whole expression returns For C/C++
programmers: The |
|
Remove the property If The whole expression returns
the |
| expression1 , expression2 | Evaluates The most common use for this operator is inside |