0% found this document useful (0 votes)
19 views10 pages

In The Last Session We Had Discussed... : Variables and Their Naming Conventions

This document discusses data types in VB. It defines data type as the characteristic of a variable that determines what kind of data it can hold. VB recognizes numeric, string, variant, date, and object variable types. Numeric and string are the two major types. Numeric can be integer, floating point with limited/extreme precision, currency, decimal, and date. Byte is used to access individual bytes and save space. The document provides ranges for numerical data types and an example of declaring a byte variable. It concludes with review questions about data types.

Uploaded by

Saroj patel
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
19 views10 pages

In The Last Session We Had Discussed... : Variables and Their Naming Conventions

This document discusses data types in VB. It defines data type as the characteristic of a variable that determines what kind of data it can hold. VB recognizes numeric, string, variant, date, and object variable types. Numeric and string are the two major types. Numeric can be integer, floating point with limited/extreme precision, currency, decimal, and date. Byte is used to access individual bytes and save space. The document provides ranges for numerical data types and an example of declaring a byte variable. It concludes with review questions about data types.

Uploaded by

Saroj patel
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 10

In the last session we had discussed...

Variables and their naming conventions

1
In the current session we shall discuss...

Data types in VB

2
Data types

• A data type is the characteristic of a variable that determines


what kind of data it can hold.
• A variable can hold a number, a string of text, a logical value,
or even a reference to an object such as form, control or
database.

3
• VB recognizes the following types of variables:
– Numeric
– String
– Varient
– Date
– Object

4
• The two major variable types are numeric and string.
• Numbers can be stored in many formats, depending on the
size of the number and its precision.
• That is why there are many types of numeric variables.
• The choice of data types for variables can make a difference in
the results of the calculations.

5
Numeric data types

• Numeric data types are basically divided into following types


1. Integers
2. Floating point with limited precision
3. Floating point with extreme precision

6
Numerical data types and its range

Data type Size (Bytes)


Integer 2
Long 4
Single 8
Double 8
Currency 8
Decimal 14
Date 8

7
Bytes data type

• The byte type is added to VB 5.


• It can hold integers between 0 and 255.
• This is basically used to save space.
• It stores data type byte wise so that we can access the
individual byte at need.
• Byte are frequently used to access binary files, image and
sound files, API calls etc.
• Dim n as Byte

8
Review Questions

• What is a data type?


• What are different data types available in VB?

9
What Next

In the next session we will discuss…..

Data types in VB cont…

10

You might also like