Script Language Reference
The Alert Message Processor uses a Basic-like scripting language to process messages and trigger alarm operations. This reference documents all available keywords, operators, and functions.
What Scripts Are Used For
Scripts are programs executed by the Message Processor to extract significant information from incoming messages and trigger alert processes accordingly. Each script is associated with a prototype configuration file and can:
- Extract alarm information from messages and activate or deactivate alarms
- Acknowledge alarms
- Dynamically create alarms from extracted data
- Communicate with external systems via serial links, TCP/IP, or SMS
- Process data from files, databases, or email mailboxes
- Handle incoming and outgoing voice telephony calls (Vocal Server, v4.0+)
Available Categories
The scripting language is organized into the following categories:
| Category | Description |
|---|---|
| Declarations | Variable declarations (DIM), function and subroutine definitions (FUNCTION, SUB), and comments (REM) |
| Program Flow Control | Conditional branching (IF/ELSE/ELSEIF) and loops (FOR, DO WHILE, DO UNTIL, LOOP WHILE, LOOP UNTIL) |
| Logical Operators | Boolean and arithmetic operators: AND, OR, XOR, NOT, DIV, MOD, EXP |
| Math Functions | Mathematical operations and numeric utilities |
| String Functions | String manipulation, parsing, and formatting |
| Array Functions | Array creation and manipulation |
| File Functions | File reading, writing, and management |
| System Functions | Operating system and environment interactions |
| Message Processor Functions | Functions specific to message processing and event handling |
| Alert API | Functions for interacting with the Alert platform (tags, alarms, acknowledgments) |
| Objects | Object types such as FILE, XMLPARSE, DBCONNECTION, MAIL, SNMPTRAP, and more |
| Vocal Server | Functions for building voice telephony applications (v4.0+) |
Script Structure
A script is a plain-text .prg file associated with a prototype. It follows Basic syntax conventions:
- Variables are declared with
DIM - Subroutines and functions are defined with
SUB/FUNCTION...END SUB/END FUNCTION - Comments begin with
REMor a single quotation mark (') - Control flow uses
IF/ENDIF,FOR/NEXT, andDO/LOOPconstructs