Siebel eScript Language Reference > Siebel eScript Commands > Data Handling Methods in Siebel eScript >
defined() Method
This function tests whether a variable or object property has been defined. Syntax
defined(var)
|
|
var |
The variable or object property you wish to query |
Returns
True if the item has been defined; otherwise, false. Usage
This function tests whether a variable or object property has been defined, returning true if it has or false if it has not. CAUTION: The defined() function is unique to Siebel eScript. Before using it, confirm that the JavaScript interpreter that will run the script supports Siebel eScript functions. Avoid using this function in a script that may be used with a JavaScript interpreter that does not support it.
Example
The following fragment illustrates two uses of the defined() method. The first use checks a variable, t. The second use checks an object t.t. var t = 1; if (defined(t)) TheApplication().Trace("t is defined"); else TheApplication().Trace("t is not defined");
if (!defined(t.t)) TheApplication().Trace("t.t is not defined"): else TheApplication().Trace("t.t is defined");
See Also
undefine() Method
|