CALLBasic Scripts

A script is merely a text file with a .bas extension and consists of processing logic between Program and EndProgram commands.

A script must start with a Program command and end with the EndProgram command. 
The processing logic or program code makes up the body of the script and is placed between the Program and EndProgram commands.

    ‘Program code goes here. 

The program code consists of Local and Global Variables, CALLBasic Commands, and Database Commands.

Code lines which start with a single apostrophe ( ‘ ) are comment lines and are not processed.
CALLBasic is very particular as to the syntax, capitalization, carriage return at the end of each line (no spaces), and must have a carriage return after the EndProgram line.

Script files can be created and edited using Notepad.  They must be saved as .bas extension.

Sample scripts are included with CALLMaster and located in the CALLMaster\Scripts\Sample Scripts folder.


Entry.bas and Exit.bas Scripts
These scripts are executed during CALLMaster system service start-up and shutdown, respectively. These files must named Entry.bas and Exit.bas and placed in the CALLMaster\Scripts folder.

Entry.bas is executed when CALLMaster service starts, before any calls are processed. It is intended to be the Audiotex initialization script.

Use this script to declare global variables and assign starting values that can be used by all lines or execute database commands at service start-up.  For example, open all the databases needed and declare initial values for global variables to be used as counters before any calls get handled.

Note: In the Entry.bas script, Local and Global Variables can only be assigned a value and cannot be reassigned. You will need to remove the variable before reassigning it to a new value .
For example: if you set Var1=10 and then reassign Var1=20 in the Entry.bas script, the value of Var1 will remain as 10.
You will need to assign Var1=10, then RemoveVar Var1, before reassigning Var1=20

The Exit.bas file performs the same function as the Entry.bas file but does so at system service shutdown time, after all calls have been processed.
By placing printing and database commands in the Exit.bas file, an application can easily print closing summary information or close all open databases.