Alchemy Data Types |
This section describes the data types available for use in a Alchemy script. A brief summary of each data type is given below.
Type | Description | Examples |
Array | A data structure consisting of a number of elements that are accessed by specifying an index. | $name = ["US", "United States"] |
A boolean can be one of three values: true, false or null. | $boolean_variable = true $access_allowed = false | |
A data column within a shapefile table. A trailing question mark ('?') indicates that one or more cells in the column may contain a null value. | %id_type %roads3? | |
Hash Table | A hash table is a one-to-one unique mapping between a key-value pair. A value may be retrieved by specifying the corresponding key. | $hashTbl = { "GB" : "Great Britain", "NZ" : "New Zealand", "US" : "United States" } |
Floating point and integer numbers are supported; these may be signed or unsigned. | 100 1.4142 -3.1416 | |
Strings are a sequence of symbols (letters, numbers and some punctuation). Strings must be surrounded by double quotation marks (" "). | "Alchemy" "1-2-3 go!" | |
Variable names must begin with a dollar sign ($) immediately followed by a letter. The remainder of the name may contain letters (A - Z, a - z), numbers (0 - 9) and underscores (_). | $variable1 $terminal_velocity |