This is an old revision of the document!
Numeric constants are any numeric characters, preceded by an optional minus sign to indicate negative numbers, and an optional decimal followed by more numeric characters to indicate floating point values. Numbers come in two types: 1) integers and 2) decimal numbers.
Examples include:
Integer Numbers |
---|
10 |
-2345 |
0 |
Positive integer values may also be expressed in binary (base 2), octal (base 8), and hexadecimal (base 16). Precede binary values with 0b (0b1110 = 14), octal with 0o (0o177 = 127), and hexadecimal with 0x (0xff = 255).
Decimal Numbers |
---|
-234.567 |
56.87 |
0.0123 |
PI |
Very large and small numbers may also be represented in scientific E notation (added in version 0.9.9.46). http://en.wikipedia.org/wiki/Scientific_notation
Scientific E Notation | |
---|---|
E Notation | Decimal Number |
2e0 | 2 |
3e2 | 300 |
1.234e10 | 12340000000 |
-5.3e4 | -53000 |
2e-1 | 0.2 |
5.12e-9 | 0.00000000512 |
String constants are zero or more characters enclosed by either double quotation marks(“) or single quotation marks (').
'I said “Hello.”' |
“Tuesday Rocks” |
'123' |
“it is Smith's” |
Boolean values represent the two values of True and false. There are defined constants true and false that represent the value 1 and 0 respectively.
True Values | False Values |
---|---|
TRUE | FALSE |
1 | 0 |
-56 | 0.0 |
9.9 | '“ |
“something” |
These constants can be used to represent the numeric values returned by the TypeOf function.
Return Values | ||
---|---|---|
Constant | Value | Type |
TYPE_UNASSIGNED | 0 | Unassigned Variable |
TYPE_INT | 1 | Integer |
TYPE_FLOAT | 2 | Decimal Number |
TYPE_STRING | 3 | String |
TYPE_ARRAY | 4 | Array Variable |
TYPE_REF | 5 | Variable Reference |
TYPE_MAP | 6 | Map |
These constants can be used to represent the numeric values returned by the Clickb and Mouseb functions. If a user has pressed more than one button the values will be added together when returned.
These constants can be used to tell the ImgSave statement which format to save the graphics window into.
Return Values | |
---|---|
Constant | Value |
IMAGETYPE_BMP | “BMP” |
IMAGETYPE_JPG | “JPG” |
IMAGETYPE_PNG | “BMP” |
These constants can be used to represent the numeric values returned by the OsType function.
Return Values | |
---|---|
Constant | Value |
OSTYPE_WINDOWS | 0 |
OSTYPE_LINUX | 1 |
OSTYPE_MACINTOSH | 2 |
OSTYPE_ANDROID | 3 |