Declaring and Using Variables A variable is an object that stores and

Declaring and using variables a variable is an object

This preview shows page 46 - 49 out of 334 pages.

Declaring and Using Variables A variable is an object that stores and represents information in a script. The value of a variable can change but the value of a literal cannot change. For example, to display a name literally, you must use the following code multiple times: TheApplication().RaiseErrorText("Aloysius Gloucestershire Merkowitzky"); To simplify this code, the following code uses a variable: var Name = "Aloysius Gloucestershire Merkowitzy"; TheApplication().RaiseErrorText(Name); The value of the Name variable changes, which allows you to use shorter lines of code and to reuse the same lines of code. About Local and Global Variables Siebel eScript includes the following types of variables:
Image of page 46
Using Siebel eScript Coding with Siebel eScript Siebel eScript Language Reference Version 8.1, Rev. A 47 Local. A variable that you declare in a function. You can reference a local variable only in the function in which you declare the variable. Global. A variable that you declare in one of the following ways: Declare the variable outside of a function. Declare the variable in the general declarations section of the application object. You can reference or modify a global variable from the following items: Any function that is associated with the Siebel object for which you declare the variable. Any object in a Siebel application in which you declare the variable. Another Siebel application. If you declare a global variable outside of a function, then you can reference that variable from any object in the Siebel application in which you declare the variable. For more information, see “Declaring a Global Variable Outside of a Function” on page 47 . If you declare a local variable with the same name as a global variable, then you cannot reference the global variable from the function in which you declare the local variable. Siebel VB includes a Global statement. You cannot use this statement in Siebel eScript. Declaring a Global Variable Outside of a Function You can declare a variable other than in the declaration section. For example: var global1 = 6; function ABC() { global1 = 8; global2 = 6; } var global2 = 8; Using a Local Variable Is Preferable to Using a Global Variable It is recommended that you use a local variable where possible instead of a global variable for the following reasons: A local variable helps you create modular code that is easier to debug and modify. A local variable requires fewer resources. It is easier for other developers to understand how you use a local variable in a single function than it is to understand how you use a global variable across an entire Siebel application.
Image of page 47
Siebel eScript Language Reference Version 8.1, Rev. A Using Siebel eScript Coding with Siebel eScript 48 If a subsequent development team encounters an object that you script with a global variable, then this team might not understand the use of the global variable. If the team uses this variable, then the team might introduce defects.
Image of page 48
Image of page 49

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

Stuck? We have tutors online 24/7 who can help you get unstuck.
A+ icon
Ask Expert Tutors You can ask You can ask ( soon) You can ask (will expire )
Answers in as fast as 15 minutes
A+ icon
Ask Expert Tutors