Hexadecimal Literals
A number sign (#) precedes a hexadecimal (hex) value. You can define literal hexadecimal integer, string, character, or binary values.
Hexadecimal strings in Jade are represented as a sequence of space‑separated hexadecimal characters.
The following example illustrates the use of string and integer hexadecimal literals in defining a series of constants.
constants
WhiteSpace = #"09 0A 0B 0C 0D 20";
MaxInt = #7FFFFFFF;
MaxInt16 = #FFFF;
BitMask01 = #55555555;
To define a binary hexadecimal literal value, enclose a sequence of space‑separated hexadecimal characters in bracket symbols ([ ]). For example:
DaysInMonth = #[1F 1C 1F 1E 1F 1E 1F 1F 1E 1F 1E 1F];
The following daysInMonth method of the
daysInMonth(isLeapYear: Boolean): Integer;
constants
//construct a compile-time value array
DaysInMonth = #[1F 1C 1F 1E 1F 1E 1F 1F 1E 1F 1E 1F];
begin
if self = 2 and isLeapYear then
return 29;
endif;
return DaysInMonth[self];
end;
