If this method Interprets the string It returns the value in the expression

If this method interprets the string it returns the

This preview shows page 176 - 179 out of 334 pages.

string, then this method attempts to interpret the string as if it is JavaScript code. If this method: Interprets the string. It returns the value in the expression argument. Cannot interpret the string. It returns the following value: undefined If the expression is not a string, then this method returns the value that exists in the expression argument. For example, calling eval(5) returns the value 5. Format eval( expression ) Table 100 describes the arguments for the Evaluate Expression method. Example The following example describes the result of using the Evaluate Expression method on different types of expressions. This method does the following work: Interprets the string in the test[0] variable because it can interpret this string as a JavaScript statement. Does not interpret the string in the test[1] variable or the test[3] variable because it cannot interpret either string as a JavaScript statement. It returns a value of undefined for each of these variables. This example includes the following code: function clickme_Click () { var msgtext = ""; var a = 7; var b = 9; var test = new Array(4); var test[0] = "a * b"; var test[1] = ToString(a * b); var test[2] = a + b; var test[3] = "Strings are undefined."; var test[4] = test[1] + test[2]; Table 100. Arguments for the Evaluate Expression Method Argument Description expression The expression that this method must evaluate.
Image of page 176
Methods Reference Data Querying Methods Siebel eScript Language Reference Version 8.1, Rev. A 177 for (var i = 0; i < 5; i++) msgtext = msgtext + i + ": " + eval(test[i]) + "\n"; TheApplication().RaiseErrorText(msgtext); Running this code produces the following result: 0: 63 1: undefined 2: 16 3: undefined 4: undefined Data Querying Methods This topic describes data querying methods and objects that contain information. It includes the following topics: “Is Defined Method” on page 177 “Is Finite Method” on page 178 “Is NaN Method” on page 179 “Exception Object” on page 179 “Function Object” on page 180 Is Defined Method The Is Defined method tests if a variable or object property is defined. It returns one of the following values: The item is defined. It returns the following value: True The item is not defined. It returns the following value: False This method is unique to Siebel eScript. For more information, see “Make Sure the JavaScript Interpreter Can Run a Function” on page 59 . Format defined( var )
Image of page 177
Siebel eScript Language Reference Version 8.1, Rev. A Methods Reference Data Querying Methods 178 Table 101 describes the arguments for the Is Defined method. Example The following example includes two uses of the Is Defined method. The first use examines a variable named t. The second use examines an object named 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"); Related Topics For more information, see “Undefine Method” on page 157 .
Image of page 178
Image of page 179

You've reached the end of your free preview.

Want to read all 334 pages?

  • Summer '16
  • Oracle
  • Type system, Siebel, Siebel eScript

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern

Ask Expert Tutors You can ask You can ask ( soon) You can ask (will expire )
Answers in as fast as 15 minutes