Sideway
output.to from Sideway






Draft for Information Only

VBScript Data Types

The data type supported by VBScript is only part of the data type supported by Visual Basic. In fact, data used in VBScript is stored in a genetic Data Type, called Variant. The Variant subtypes of VBScript is a subtype name given to some specific types of variables or data storage according to the data type classification. While the data type is a data type name given to name the form of binary storage. In general, a Variant variable can hold any valid data supported by VBScript. Both Variant subtype and data type share the same name and equivalent meaning.

VBScript Variant

Variant is the only date type used in VBScript. A Variant is a genetic data type that can be used to contain different kinds of data used in VBScript. Therefore, all returns returned by all functions in VBScript must also be Variants.

In a general sense, data stored in a Variant is in form of characters. VBScript always automatically assumes the most appropiate data form for a Variant when operating or manipulating with a Variant. Therefore, a Variant can behave as a number when using in a numeric context and as a string when using in a string context.

Visual Basic Data Types

In general, data types are always depend on implementing version, application, and platform. The possible data type used in Visual Basic is in following table. The Currency data subtype is replaced by the Decimal data type in .Net. In general, money value is a scaled LongLong Integer stored in form of Decimal data type.

Visual Basic typeCommon language runtime type structureNominal storage allocationValue rangeRemarksBooleanBoolean(Depends on implementing platform)True or False ByteByte1 byte0 through 255 (unsigned) Char (single character)Char2 bytes0 through 65535 (unsigned) DateDateTime8 bytes0:00:00 (midnight) on January 1, 0001 through 11:59:59 PM on December 31 DecimalDecimal16 bytes0 through +/-79,​228,​162,​514,​264,​337,​593,​543,​950,​335 (+/-7.9...E+28) † with no decimal point; 0 through +/-7.922​816​251​426​433​759​354​395​0335 with 28 places to the right of the decimal; smallest nonzero number is +/-0.000​000​000​000​000​000​000​000​0001 (+/-1E-28) <† In scientific notation, "E" refers to a power of 10. So 3.56E+2 signifies 3.56 x 102 or 356, and 3.56E-2 signifies 3.56 / 102 or 0.0356. > Double (double-precision floating-point)Double8 bytes-1.79769313486231570E+308 through -4.94065645841246544E-324 † for negative values; 4.94065645841246544E-324 through 1.79769313486231570E+308 † for positive values IntegerInt324 bytes-2,147,483,648 through 2,147,483,647 (signed) Long (long integer)Int648 bytes-9,223,372,036,854,775,808 through 9,223,372,036,854,775,807 (9.2...E+18 †) (signed) ObjectObject (class)4 bytes on 32-bit platform 8 bytes on 64-bit platformAny type can be stored in a variable of type Object SByteSByte1 byte-128 through 127 (signed) Short (short integer)Int162 bytes-32,768 through 32,767 (signed) Single (single-precision floating-point)Single4 bytes-3.4028235E+38 through -1.401298E-45 † for negative values; 1.401298E-45 through 3.4028235E+38 † for positive values String (variable-length)String (class)Depends on implementing platform0 to approximately 2 billion Unicode characters UIntegerUInt324 bytes0 through 4,294,967,295 (unsigned) ULongUInt648 bytes0 through 18,446,744,073,709,551,615 (1.8...E+19 †) (unsigned) User-Defined (structure)(inherits from ValueType)Depends on implementing platformEach member of the structure has a range determined by its data type and independent of the ranges of the other members UShortUInt162 bytes0 through 65,535 (unsigned) 

VBScript Variant Subtypes

Although the Variant data type is the only data type used in VBScript, the contained data in a Variant is always subdivided into subtypes according to the supported categories of information. Since a Variant can always behaves in the most appropriate way for the contained data automatically, any kind of data can be simply assigned to a Varient in most case without knowing about the subtypes.

The list of Variant Subtypes are: Null, Empty, Boolean, Byte, Integer, Long, Single, Double, Currency, Date, String, Object, Error.

VBScript Variant SubTypes by VarType Function

Table of  vbscript data subtypes by VarType number value.

Results on Microsoft Windows 8.1 Pro x64, Microsoft-IIS/8.5, VBScript Version 5.8 of page /sideway/default.asp
VB ConstantVB Constant ValueDescriptionvbEmpty0to specify a Variant variable which contains Empty, and is uninitialized or has never been assigned a value.vbNull1to specify a Variant variable which contains Null, and has no valid data.vbInteger2to specify a Variant Integer variable which contains an Integer value.vbLong3to specify a Variant Long variable which contains a Long integer value.vbSingle4to specify a Variant Single variable which contains a Single-precision floating-point value.vbDouble5to specify a Variant Double variable which contains a Double-precision floating-point value.vbCurrency6to specify a Variant Currency variable which contains a Currency value and is stored in form of a Decimal data typevbDate7to specify a Variant Date variable which contains a Date value with Date and/or Time.vbString8to specify a Variant String variable which contains a character String value.vbObject9to specify a Variant Object variable which contains an Automation object reference.vbError10to specify a Variant Error variable which contains a Error code value.vbBoolean11to specify a Variant Boolean variable which contains a Boolean value and is stored in form of an Integer data type.vbVariant12to specify a Variant Subtype variable which contains a variant value, and is only used with arrays of variants.vbDataObject13to specify a Variant DataObject variable which contains a non-ActiveX Automation object reference or a data-access object reference.vbDecimal14to specify a Variant Decimal variable which contains a 96 bit scaled real.vbByte17to specify a Variant Byte variable which contains a Byte value.vbLongLongNot Availableto specify a Variant LongLong variable which contains a LongLong integer value and is valid on 64-bit platforms only.vbUserDefinedTypeNot Availableto specify a Variant variable of UserDefinedType which is a varible containing a User-Defined value.vbArray8192to specify a Variant Array variable which contains an array value. Use VarType( ) And 255 to get the type of element stored in the array.

VBScript Variant SubTypes by TypeName Function

Table of  vbscript data subtypes by TypeName name value.

Type NameType ValueDescriptionEmptyvbEmptyto specify a Variant variable which contains Empty, and is uninitialized or has never been assigned a value.NullvbNullto specify a Variant variable which contains Null, and has no valid data.IntegervbIntegerto specify a Variant Integer variable which contains an Integer value.LongvbLongto specify a Variant Long variable which contains a Long integer value.SinglevbSingleto specify a Variant Single variable which contains a Single-precision floating-point value.DoublevbDoubleto specify a Variant Double variable which contains a Double-precision floating-point value.CurrencyvbCurrencyto specify a Variant Currency variable which contains a Currency value and is stored in form of a Decimal data typeDatevbDateto specify a Variant Date variable which contains a Date value with Date and/or Time.StringvbStringto specify a Variant String variable which contains a character String value.Not AvailablevbObjectto specify a Variant Object variable which contains an Automation object reference.ErrorvbErrorto specify a Variant Error variable which contains a Error code value.BooleanvbBooleanto specify a Variant Boolean variable which contains a Boolean value and is stored in form of an Integer data type.Not AvailablevbVariantto specify a Variant Subtype variable which contains a variant value, and is only used with arrays of variants.DataObjectvbDataObjectto specify a Variant DataObject variable which contains a non-ActiveX Automation object reference or a data-access object reference.DecimalvbDecimalto specify a Variant Decimal variable which contains a 96 bit scaled real.BytevbByteto specify a Variant Byte variable which contains a Byte value.LongLongvbLongLongto specify a Variant LongLong variable which contains a LongLong integer value and is valid on 64-bit platforms only.Not AvailablevbUserDefinedTypeto specify a Variant variable of UserDefinedType which is a varible containing a User-Defined value.Not AvailablevbArrayto specify a Variant Array variable which contains an array value. Use VarType( ) And 255 to get the type of element stored in the array.ObjectNot Availableto specify a generic Variant Object variable which contains an Object reference of any type.<object type>Not Availableto specify a specific Variant Object variable which contains an Object reference to an Object that is not Nothing, and with the name <object type>.UnknownNot Availableto specify a Variant variable with a non-ActiveX Automation object reference of unknown object type.NothingNot Availableto specify a Variant Object variable which contains an Object reference to Nothing that is the Object reference has been either explicitly set to Nothing or set to the returned value of Nothing.Variant()Not Availableto specify a generic Variant Array variable which contains an Array value of any type with the TypeName of the element followed by ( ).

©sideway

ID: 180400014 Last Updated: 2018/4/14 Revision:

IMAGE

Home (1)

Business

Management

HBR (3)

Information

Recreation

Hobbies (7)

Culture

Chinese (1097)

English (330)

Reference (60)

Computer

Hardware (147)new

Software

Application (184)

Digitization (22)

Numeric (19)

Programming

Web (507)

HTML

Knowledge Base

Common Color (1)

Html Entity (Unicode) (1)

Html 401 Special (1)

OS (305)new

MS Windows

Windows10 (1)

DeskTop (5)

Knowledge

Mathematics

Formulas (7)

Number Theory (51)

Algebra (14)

Trigonometry (18)

Geometry (18)

Calculus (66)

Engineering

Tables (8)

Mechanical

Control

Process Control (1)

Mechanics (1)

Rigid Bodies

Statics & Dynamics (128)

Fluid (5)

Fluid Kinematics (5)

Acoustics (19)

FiniteElement (2)

Biology (1)

Geography (1)


facebook
Latest Updated Links

Copyright © 2000-2018 Sideway . All rights reserved Disclaimersfacebook last modified on 08 Mar 2018