Siebel eScript Language Reference > Siebel eScript Language Overview >

Functions in Siebel eScript

A function is an independent section of code that receives information from a program and performs some action with it. Functions are named using the same conventions as variables.

After a function has been written, you do not have to think again about how to perform the operations in it. When you call the function, it handles the work for you. You only need to know what information the function needs to receive—the parameters—and whether it returns a value to the statement that called it.

TheApplication().RaiseErrorText() is an example of a function that provides a way to display formatted text in the event of an error. It receives a string from the function that called it, displays the string in an alert box on the screen, and terminates the script. TheApplication().RaiseErrorText() is a void function, which means that it has no return value.

In Siebel eScript, functions are considered a data type. They evaluate the function's return value. You can use a function anywhere you can use a variable. You can use any valid variable name as a function name. Use descriptive function names that help you keep track of what the functions do.

Two rules set functions apart from the other variable types. Instead of being declared with the var keyword, functions are declared with the function keyword, and functions have the function operator, a pair of parentheses, following their names. Data to be passed to a function is enclosed within these parentheses.

Several sets of built-in functions are included as part of the Siebel eScript interpreter and are described in this manual. These functions are internal to the interpreter and may be used at any time:

Siebel eScript Language Reference