Type Characters

Identifier type characters

Type characterData typeExample
Dim a%
Dim a#
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
Numeric, no fractional part, too large for 64-bit IntHuge
Numeric, fractional partReal
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

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