The following types can be used in scripts and templates:
Type
|
Description
|
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:
|
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 decimal string
|
Integer
|
64bit 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 decimal 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");
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
|