

Different type of variables allow to store different value ranges with different precisions.

These types of variables are used to hold positive and negative numeric values with decimal points, i.e. In particular this is used in Windows 32 APIs for pointers and handles. LongPtr usually used for writing portable code that can run in both 32-bit and 64-bit environments. Represents Long type (4 bytes) on 32-bit systems and LongLong type (8 bytes) on 64-bit systems. LongLong is a valid declared type only on 64-bit platforms.

Type declaration character for LongLong is ^. The function of converting to Long is CLng LongLongĪllocates 8 bytes of storage. The type declaration character for long is &. The function of converting to Integer is CInt. The type declaration character for integer is %. The function of converting to Byte is CByte. Run-time error '6' overflow when assigned integer value out of the accepted range ByteĪllocates 1 byte of storage. If the assigned value doesn't fit the range Run-time error '6' overflow will be displayed at the compile time. Different numeric types allow storing different value ranges and requires different size of the allocated storage. Numeric type variables are used to hold positive and negative integer values (without the decimal point), e.g. Most of the types provide specific function to convert the value from a variant. Some of the types have declaration character which can be used to explicitly define the type of the variable in a short form. Each type allocates different size of memory storage. The following classifications list different standard types in Visual Basic grouped by categories.
