User Tools

Site Tools


en:constants

This is an old revision of the document!


Constants

Numeric Constants

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 NotationDecimal Number
2e02
3e2300
1.234e1012340000000
-5.3e4-53000
2e-10.2
5.12e-90.00000000512
2016/01/01 22:41

String Constants

String constants are zero or more characters enclosed by either double quotation marks(“) or single quotation marks (').

Examples

'I said “Hello.”'
“Tuesday Rocks”
'123'
“it is Smith's”
2016/01/01 22:42

Boolean Constants

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.

Examples

True ValuesFalse Values
TRUEFALSE
10
-560.0
9.9'“
“something”
2016/08/09 10:54 · admin
Color Constant (Name)ARGB ValuesInteger
BLACK255, 0, 0, 04278190080Black
WHITE255, 255, 255, 2554294506744White
RED255, 255, 0, 04294901760red
DARKRED255, 128, 0, 04286578688darkred
GREEN255, 0, 255, 04278255360green
DARKGREEN255, 0, 128, 04278222848darkgreen
BLUE255, 0, 0, 2554278190335blue
DARKBLUE255, 0, 0, 1284278190208darkblue
CYAN255, 0, 255, 2554278255615cyan
DARKCYAN255, 0, 128, 1284278222976darkcyan
PURPLE255, 255, 0, 2554294902015purple
DARKPURPLE255, 128, 0, 1284286578816darkpurple
YELLOW255, 255, 255, 04294967040yellow
DARKYELLOW255, 128, 128 ,04286611456darkyellow
ORANGE255, 255, 102, 04294927872orange
DARKORANGE255, 176, 61 ,04289344256darkorange
GREY255, 164, 164 ,1644288980132grey
DARKGREY255, 128, 128 ,1284286611584darkgrey
CLEAR0, 0, 0, 00
2016/08/12 21:00 · admin
Return Values
ConstantValueType
TYPE_UNASSIGNED0Unassigned Variable
TYPE_INT1Integer
TYPE_FLOAT2Decimal Number
TYPE_STRING3String
TYPE_ARRAY4Array Variable
TYPE_REF5Variable Reference
TYPE_MAP6Map
2016/08/13 14:25 · admin
 
Return Values
ConstantValue
IMAGETYPE_BMP“BMP”
IMAGETYPE_JPG“JPG”
IMAGETYPE_PNG“BMP”
2016/08/14 15:42 · admin
Return Values
ConstantValue
OSTYPE_WINDOWS0
OSTYPE_LINUX1
OSTYPE_MACINTOSH2
OSTYPE_ANDROID3
2016/08/14 15:45 · admin
en/constants.1471210572.txt.gz · Last modified: 2020/02/28 10:46 (external edit)