User Guide : Scripting : Variables : Variant Data Type
 
Share this page             
Variant Data Type
DataConnect offers many data types, covering many types of data. Some of the types relate to data structures from other programming languages, while some are internal.
Note:  You cannot declare anything as Integer or a Long data type with EZscript. The advantage of this is that it simplifies the expressions. The disadvantages are that certain pieces of code using variant may process a little more slowly than others, or may not catch certain classes of programming errors.
The default data type is variant. Variant is a self-describing data type that can hold simple numeric or string values. Variants can also make additional distinctions about numeric information. Global variables of the variant data type have initial values that you can override in configurations.
Variants can hold numeric information ranging in size from a Boolean byte to complex values like text. These categories within a variant are called subtypes. Variant subtypes broaden the list of possible types of data. This table shows the subtypes that variants can contain.
Subtype
Internal Size
Value Range
Text
2*(len+1) + overhead in Windows 4*(len+1) + overhead in Unix
Up to 2 billion characters in Windows (32- and 64-bit) Up to 2^64 characters in 64-bit Unix
Short
2 bytes
16-bit signed or unsigned binary integer, therefore range is:
Unsigned: 0 to 65535
Signed: -32768 to 32767
Integer
4 bytes
32-bit signed or unsigned binary integer, therefore range is:
Unsigned: 0 to 4294967295
Signed: -2147483648 to 2147483647
Float
8 bytes
Precision of about 16 digits. Standard IEEE 64-bit floating point.
Decimal
Varies
Precision of 76; scale of 38. Actual size depends on output format.
Date
12 bytes
For value range, see comments for DateTime. Based upon DateTime with a time of 0.
Time
12 bytes
For value range, see comments for DateTime. Based on DateTime with a date of 0.
DateTime
12 bytes
DateTime can represent date and time to nanosecond precision, starting with January 1, 1 AD. Julian to Gregorian transition uses England-Scotland transition, where September 14, 1752, immediately follows September 2.
Boolean
1 byte
True or False
Name
Varies
A string parsed into these name parts:
honorific
first
middle
last
title
Quadword
8 bytes
32-bit signed or unsigned binary integer, therefore range is:
Unsigned: 0 to 18446744073709551615
Signed: -9223372036854775808 to 9223372036854775807
Interval
32 bytes
Range depends on output format and interval type.