There are many ways of declaring variables in Visual Basic. In Visual Basic if we declare a variable without any data type by default the data type is assigned as default. Stores any type of data and is the default Visual Basic data type. Values are internally stored as -1 (True) and 0 (False) and any non-zero value is considered as true. These are not stored as numeric values and cannot be used as such. īoolean data types hold either a true or false value. A variable declared as date type can store both date and time values and it can store date values up to. A variable length string can store approximately 4 billion characters. It supports 4 digits to the right of decimal point and 15 digits to the left Store large floating value which exceeding the single data type value Store integer values in the range of 0 – 255 A list of Visual Basic’s simple data types are given below. In addition, some types can interchange with some other types. Each data type has limits to the kind of information and the minimum and maximum values it can hold. Visual Basic supports a vast array of data types. The fundamental data types in Visual Basic including variant are integer, long, single, double, string, currency, byte and Boolean. When a variable is declared, a data type is supplied for it that determines the kind of data they can store.
![visual basic datatype visual basic datatype](http://passyworldofict.com/wp-content/uploads/2018/12/LessonScrPrt1JPG.jpg)
The variant data type can store numeric, date/time or string data.
![visual basic datatype visual basic datatype](https://slidetodoc.com/presentation_image/5abaec5b978389aa80fb7680fd3845e5/image-20.jpg)
#VISUAL BASIC DATATYPE CODE#
The value of a Global variable is available to any procedure, in any Form or code module.
![visual basic datatype visual basic datatype](https://itsourcecode.com/wp-content/uploads/2019/11/VB.Net-Data-Types-and-variable-Declaration-with-DIM.png)