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 32-bit IntLong
2147483648
2_147_483_648
Numeric, no fractional part, too large for 64-bit IntHuge
9223372036854775808
9_223_372_036_854_775_808
Numeric, fractional partReal
3.14159
Begins with a backtickChar
`A, `@`, `Cr
Enclosed in double quotation marksString
"Hello, world!"
Begins with a dollar signString
$CR $13 $LINE
Begins with an "at" sign and digitsDate
@2013-12-11@10:09:08

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