Equality If the values of all expressions in the statement are equal to each

# Equality if the values of all expressions in the

• Test Prep
• 334

This preview shows page 38 - 40 out of 334 pages.

== Equality. If the values of all expressions in the statement are equal to each other, then the entire statement is true. If the value of one expression is not equal to the value of any other expression, then the entire statement is false. CAUTION: The equality operator (==) is different from the assignment operator (=). If you use the assignment operator to test for equality, then your script fails because Siebel eScript assigns the right hand side of the expression to a variable that resides on the left hand side of this expression. For more information, see “Using the Equality Operator with a Strongly Typed Variable” on page 39 . != Inequality. If the value of one expression is different from the value of any other expression, then the entire statement is true. If the value of all expressions in the statement are equal, then the entire statement is false. < Less than. If the expression is a < b, and if a is less than b, then the statement is true. > Greater than. If the expression is a > b, and if a is greater than b, then the statement is true. <= Less than or equal to. If the expression is a <= b, and if a is less than or equal to b, then the statement is true. >= Greater than or equal to. If the expression is a >= b, and if a is greater than or equal to b, then the statement is true.
Using Siebel eScript Using Operators in Siebel eScript Siebel eScript Language Reference Version 8.1, Rev. A 39 Example of Using Logical Operators and Conditional Expressions Assume you design a simple guessing game where you configure Siebel CRM to choose a number between 1 and 100. In this game the user attempts to guess the value of this number. The computer provides feedback if the user is correct or if the user answer is higher or lower than the number that the computer chooses. The following Siebel eScript code implements this guessing game. Assume the GetTheGuess function is a custom function that obtains the guess: var guess = GetTheGuess(); //get the user input, which is 1, 2, or 3 target_number = 2; if (guess > target_number) { TheApplication().RaiseErrorText(“Guess is too high.”); } if (guess < target_number) { TheApplication().RaiseErrorText(“Guess is too low.”); } if (guess == target_number); { TheApplication().RaiseErrorText(“You guessed the number!”); } In this example, the action that Siebel eScript performs depends on if the value in the parenthesis in an If statement is true or false: True. It runs the statement block that follows this If statement. False. It ignores the statement block that follows this If statement and runs the script that occurs immediately after the statement block. Using the Equality Operator with a Strongly Typed Variable If ST eScript code does an equality operation, then it compares different objects depending on the following types of variables that are involved in the comparison: Typeless variable. It compares object values.

#### 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

• 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.

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

• 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.

Dana University of Pennsylvania ‘17, Course Hero Intern

• 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.

Jill Tulane University ‘16, Course Hero Intern