PilotScript is a functional expression language that allows you to filter and manipulate
data in a variety of ways. It is useful for customizing how data is processed in a
pipeline.
PilotScript has its origins in a subset of Oracle's PL/SQL language (it is not
object-oriented.) It supports Boolean operations similar to the SQL WHERE clause, property
assignment to data record and protocol properties, simple branching with IF/THEN/ELSE
statements, and FOR/WHILE loops.
PilotScript includes many functions for operating on data properties. For details, see
PilotScript Reference.
PilotScript Basics
- Comments can span multiple lines and are indicated by the syntax:
/* This is a
comment */. All text between the opening and closing slashes is ignored.
- Statements are separated with semicolons (
;) and can span multiple
lines. Expressions are evaluated from left to right.
- A text string value can be written with either single quote marks (
')
or double quote marks ("). Strings with singlequotes strings are
interpreted literally. 'line1\nline2' is interpreted as
line1\nline2;. Strings with double quotes are subject to backslash
interpretation. Use double quotes to insert returns, tabs, and other formatting codes into
your strings.
- Functions can take as arguments, data property names or references. For example,
a := NumValues(myprop); /*no quotes*/. PilotScript can also operate on
strings (with double or single quotes). For example: myprop :=
"abc";.
- Numerous operators are available for string pattern matching, including
EQ, NE, GT, GE,
LT, LE, LIKE, and
RLIKE.
- Regular expressions are supported for pattern matching (
RLIKE) and in
other specific PilotScript functions, such as RSPLIT and
RKEEP.
- Supported arithmetic operators include basic arithmetic (
+,
-, *, /), increment/decrement
(++, --), and comparisons (>,
<, >=, <=,
==).
- Basic math expressions are supported (
SQRT, LOG,
SIN, COS, EXP, SUM,
BIN, etc.).
- For Boolean literals, two keywords are used to represent values
TRUE
and FALSE.
- For numeric literals, all numbers are treated internally as double precision floating
point numbers, but you can enter integer, floating point, or exponential notations.
- PilotScript supports conditionals (
IF, NOT,
AND, OR) and looping (WHILE and
FOR).
|