Type Characters

Identifier type characters

Type characterData typeExample
%Int
Dim a%
!Real
Dim a!
$String
Dim a$

Default literal types

The form of a literal normally determines its data type. The following table summarizes the defaults.

Textual form of literalDefault data typeExample
Numeric, no fractional partInt
32768 32_768
Numeric, no fractional part, too large for IntInt128
9223372036854775808
9_223_372_036_854_775_808
Numeric, fractional partReal
3.14159 4.1e-8
Enclosed in backticksChar
`A` `@`
Starts with percentInt
%CR %RETURN;
Enclosed in double quotation marksString
"Hello, world!"
Starts with a dollar signString
$CR $13 $LINE
Starts with an at-sign, with three groups of numbersDateTime
@2013.12.11 @2013-12-11 
@2013/12/11 @10:09:08
Starts with an at- or currency sign, numeric, fractional partFixed64
@12.34 @$12.34 ¤12.34
@£1_234_567.89

Hexadecimal, octal, and binary literals

Number basePrefixValid digitsExamples
Hexadecimal (base 16)&H0–9 A–F
&HFFF &HFF_00_2A
Octal (base 8)&O0–7
&O777 &O377_777
Binary (base 2)&B0 1
&B101010 &B11111111_11111111

See also