CitectVBA Programming Reference > Understanding CitectVBA Language Basics > Numbers


CitectVBA supports three representations of numbers: decimal, octal, and hexadecimal.

To indicate the use of octal (base 8) or hexadecimal (base 16) numbers, prefix the number with &O or &H respectively. If no prefix is included with a number, it is treated as decimal (base 10). For example:

Dim vntVar as Variant
vntVar = 12345 ' assign decimal value
vntVar = &o12345 ' assign octal value
vntVar = &h12345 ' assign hexadecimal value

Most numbers used in CitectVBA formulas are decimal numbers. Decimal numbers consist of integral values (known as integers) positioned to the left of the decimal point, and fractional values (known as fractions) positioned to the right of the decimal point. If the decimal point is omitted, the number is treated as an integer (whole number with no fraction).

When using numbers in CitectVBA, consideration needs to be given to the data type of the variables that hold and store the numbers, as well as to the behaviour of CitectVBA when dealing with numbers. For details, see Numeric Data Types, Floating Point Calculation Rules, and Rounding Numbers.

See Also

Date Handling

Variant Declaration




CitectVBA Data Types

CitectVBA Function Reference