|Storing numbers and text|
Variables allow you to store numbers and text which can be modified during the course of a script's runtime. Variables are designated by names which can contain any sequence of numbers or letters. The first character of a variable name, however, must always be a specific symbol, otherwise known as that variable's identifier. The maximum length for a variable name is 32 characters. Alambik lets you use five kinds of variables:
Ps : Variable names are limited to 32 charsFollowing is a table of the identifiers and ranges for different variable types.
This type of variable contains a sequence or "string" of characters.
Note: It's possible to concatenate strings of characters using
the plus "+" sign.
This type of variable contains only whole numbers.
Note : Alambik will automatically convert a number into its hexadecimal equivalent if that number is preceded by "0x". For example:
%test = 0xFF
This type of variable contains numbers expressed in floating-point notation.
Floating point variables allow the use of numbers with decimal points.
They are thus useful for mathematical work as well as for calculating
This type of variable contains an ObjectID (pointer). An ObjectID is essentially a numeric variable which isn't meant to be used for normal runtime operations (like adding, subtracting, etc.). Instead, ObjectIDs are special names which represent Alambik objects and let you manipulate them during a script's runtime.
Every time an instruction takes an ObjectID as a parameter, you can replace the ObjectID parameter value with any instruction that returns the type of ObjectID required.
This kind of variable can be used to create a array by using DIM and
An array must, however, always contain variables of the same type (either
all %'s or all $'s).
Indeed, strings are already two-dimensional arrays indexed by character location. You can directly access strings as you would any array, as shown below:
$test = "hello
Redim allows you to scale the dynamic array variables.
Origin allows you to choose the origin of a array:
|Converting Variable Types|
int <-> float
To convert a numerical value into text:
"" (Full display)
To convert a number into ASCII:
Char = Text.char.convert
To convert text into a number :
Number = Number.convert(String)
To convert a character into a number:
Digit = Number.digit.convert
To convert an RGB color into a Packed color :
ColorPacked = Number.color.convert (Red, Green, Blue)