Pascal Script Function Listing
The following document gives a list of commands available from the Pascal Script window, enabling the Developer to write custom scripts within their Orixa App
String Variables are indicated with single quotes. When a SQL Statement or other string-variable is drafted which itself contains single quotes these must be doubled-up, 2 single quotes together indicating that a single quote mark is present in the string.
Numeric Operators are generally identical to other mathematical language sitautions, so "+", "-", "=", ">=", "<" etc., are all used as expected.
Comments: Two forward slashes "//" are used to comment out a single line. Multi-line comments can be formed by enclosing text to "/*" and "*/".
Assignment is done using ":=" ("set equal to") as in: MyStringVariable:= 'This is a variable';
End of line: The semi-colon is used to indicate an end of line.
Logical Operators: The keywords: IN, AND, OR, XOR work as expected in logical mathematical languages.
Begin end: Statements can be clustered logically using begin end, for example after an "if" condition all statements between begin and end will be called if the "if condition evaluates as true.
"If" statement: if <boolean condition> then <statements> else. There is no "end-if" if statements end with a semi-colon.
"For" statement: for <variable>:= <value 1> to <value 2> do … can also be expressed as for <variable>:= <value 2> downto <value 1> do
"Case" statement: case <variable> of [list of values] : <statements> ; else <statements> ;
"Try" statement: try <statements> except <statements> end; …can also be expressed as try <statements> finally <statements> end;
Var: All variables must be declared with their data-types prior to use in a script. ie
var
strName: String;
iID: Integer;
aValue: Float;
begin
<statements>
end.
Basic data-types: String (any length of alpha-numeric characters), Char (single character), Integer (whole number), Real, Double, Extended, (number with fractional part), Boolean (true/false), Array.
Enumerable-types: These can be declared, and used. ie
MyAnimals = (dog, cat, fish, horse);
Genders = (male, female, unknown, other);