|
ScriptPro Editor This topic is for use by scriptwriters who are using ScriptPro Editor to create custom scripts for their agencies. Agents can go to Using ScriptPro Scripts for more information about using custom or standard scripts within Travelport Smartpoint. |
Variables
A Script can contain an unlimited number of variables (symbolic names representing values that can be different every time the script is executed).
Script variables are either local, global or context global depending on whether the variable is used within a script or by more than one script.
Variable scope
The three types of variables and the characteristics of each are listed below.
Variable names
All variables are upper and lower case sensitive. No spaces are allowed. A number cannot be the first character of a variable name.
Example: date_variable and DATE_variable would be treated as separate variables.
Reserved words cannot be used as variable names.
Global variable names begin with an ampersand (&) and must be declared in all scripts that use that variable as same name and type.
Format: &variablename
Context Global variable names begin with a dollar sign ($) and must be declared in all scripts that use that variable as same name and type.
Format: $variablename
Variable name length and permitted characters
User-defined variable names can be up to 4080 characters of alphabetic and/or numeric characters including the underscore (_).
Dialog Box input types
The five Dialog box input types are declared as follows in the Script's Variable Table:
- Alphanumeric""
- Numeric0
- Date (mm/dd/yy)'00/00/00'
- Airdate (ddmmm)'00XXX'
- ANSI""
Variables used in dialog boxes are automatically added to the variables table when the dialog is transferred into the script, but are not automatically deleted if the dialog box is removed from the Script.
Variables used as a FLAG
FLAG
A FLAG is Boolean value variable and is used to check for existence of a particular condition or event. When part of a code is completed, the flag is turned on (1) to indicate that certain operations have been executed.
Analogy
On Halloween, if the lights are on (flag=1) at a house, you go to that house for candy. If the light is off (flag=0), you go to the next house.
Used with CASE
FLAG is not a command, but is declared as a variable (flag = 0) in the variable declaration area of your script. It is most often used with CASE statements. In particular, flags are used when other choices might exist besides the choices in a CASE statement.
Example: A CASE statement may involve a list of preferred hotels. If one of the hotels is selected, the FLAG will be turned on (flag = 1). If none of the hotels in the CASE statement are selected, the FLAG will remain off (flag = 0). The script would then allow the user to input a different selection.