The following types can be used in scripts and templates:

Type

Description

Array

A collection of elements, all of the same type, stored in a contiguous block of memory. Arrays are zero-indexed, meaning the first element is accessed with index 0. The size of an array is fixed upon creation.

Notations:

  • Dynamic array. E.g. var a: array of string;
  • Static array. E.g. var a: array[0..9] of string;

Methods:

  • Add(item)
    Add an item to a dynamic array
  • Copy([index[, count]])
    Creates a new array that holds a (shallow) copy of the items, there are three forms:
    • Copy() - Copies the whole array
    • Copy(index) - Copies all items starting from index
    • Copy(index, count) - Copies count items starting from index
  • Delete(index[, count])
    Deletes one or more items from a dynamic array
  • High
    Returns the higher bound of an array
  • Length
    Returns the length of an array
  • Low
    Returns the lower bound of an array
  • SetLength(length: Integer)
    Resize a dynamic array
  • Swap(index1, index2)
    Swaps the items at the specified indexes

Boolean

True or False
When casting a Boolean as Integer, by convention True maps to 1, False maps to 0. When casting an Integer as Boolean, 0 maps to False, all other values map to True.

Methods:

  • ToString
    Conversion to string

Float

Double-precision floating point. 15 significant digits, exponent -308 to +308.
Presence of a dot "." differentiates literals from an Integer.

Notations:

  • Normal. E.g. 948.4685
  • Exponential. E.g. 9484685e23

Methods:

  • ToString
    Conversion to string

Integer

64-bit signed integer. From -9223372036854775808 to 9223372036854775807.

Notations:

  • Decimal. E.g. 948 ; -65190
  • Hexadecimal. E.g. $1AF or 0x1AF
  • Binary. E.g. 0b10011101

For formatting purposes, the underscore character "_" is accepted and ignored in Hexadecimal and Binary literals.

Methods:

  • ToString
    Conversion to string

String

Mutable, copy-on-write, 1-based, UTF-16 string. Strings can be delimited by a single or a double-quote.
In a single-quoted string, a single quote can be expressed by doubling it. In a double-quoted string, a double-quote can be expressed by doubling it. Double-quoted strings can span multiple lines.

Explicit Unicode characters can be specified by using # followed by an integer value (decimal or hexadecimal). Characters specified this way are always understood as Unicode value:

Print('Hello'#13#$0D'World');

Will print 'Hello' followed by CR+LF (ASCII code 13 and 10), followed by 'World', it can also be defined with:

Print("Hello
World");

See also: String related functions

Methods:

  • After(Delimiter: string): string
    Returns characters after a delimiter
  • Before(Delimiter: string): string
    Returns characters before a delimiter
  • Contains(SubString: string): Boolean
    Returns true if the string contains the sub-string
  • DeleteLeft(N: integer): string
    Deletes N characters to the left
  • DeleteRight(N: integer): string
    Deletes N characters to the right
  • Dupe(N: integer): string
    Duplicate the string N times
  • EndsWith(SubString: string): Boolean
    Returns true if the string ends with the sub-string
  • High
    Index of last letter
  • Left(N: integer): string
    Return N characters to the left
  • Low
    Index of first letter
  • LowerCase
    Converts to ASCII lower case
  • Length
    Length of the string
  • Reverse
    Returns a version of the string with the characters reversed
  • Right(N: integer): string
    Return N characters to the right
  • Split(Separator: string): array of string
    Split a string on a separator and returns an array of strings
  • StartsWith(SubString: string): Boolean
    Returns true if the string starts with the sub-string
  • ToBoolean
    Converts to Boolean
  • ToFloat
    Converts to float
  • ToFloatDef(DefaultValue: float)
    Tries to convert to float, use DefaultValue if not possible
  • ToInteger
    Converts to integer
  • ToIntegerDef(DefaultValue: integer)
    Tries to convert to integer, use DefaultValue if not possible
  • ToLower
    Converts to lower case
  • ToUpper
    Converts to upper case
  • Trim
    Trim control characters left and right
  • TrimLeft
    Trim left control characters
  • TrimRight
    Trim right control characters
  • UpperCase
    Converts to ASCII upper case

TDateTime

Represents a date and time as a double-precision floating point value. The integer part represents the number of days since December 30, 1899, while the fractional part represents the time of day. The range allows representation of dates from January 1, 0001 to December 31, 9999.

Note: Alias of the Float type.

See also: Date/Time related functions