SlideShare a Scribd company logo
Chapter One
Data
 The Name: Text.
 Birthdate: Date.
 Gender: Boolean value.
 Family members: numeric value
Numeric
Integers
Integer
Byte
Long
Short
Non
Integers
Single
Double
Decimal
Characters
String
(Gp of
letters)
Char
(one letter)
Miscellanous
Boolean
Date
Object
Each data type has:
1. A storage space in the memory: such as (Integer) when used It occupies (4 bytes).
2- A range of values: minimum and maximum range of values type
Ex: (Byte) starts with "0" and ends with "255".
Constants and Variables
Variables Constantans
Defenition
Are reserved Places in the computer 's
memory that have Names and Data types
that store values that can be changed during
the execution of program
Are reserved Places in the computer 's memory that have
Names and Data types that store values that can not be
changed during the execution of program
Declaratio
n
Dim
Dim Variable name As data Type
Const
Const constant name As Data Type = Value
Ex
Dim UserName As String Const Pi As Single =22/7
Rules for naming the Constants and variables: :
1. names must begin with a letter or underscore (_).
2. names Should not contain symbols or special characters
(e.g.: ?,*,^, -, +,.)
3. Variable names consist of letters, numbers, and underscores (_).
4. Do not use reserved words (Visual Basic.NET Language Keywords)
such as (single, Dim, As).
5. It is preferable that the Variable name reflects its content.
1- Text valves are written between double quotes (" ")
Const Cinema As string = "Royal"
2- (# #)are used while writing date or time.
Const Birthdate As Date= #1/7/2011#
 Assignment statement:
Examples of values of assignment ststment
1) Abstract Value : Ex: Area =5 Text = "Egypt"
2) (Value from Variable ): Area = N1
3) (Value from Property): Name = TextBox1.Text
4) ( Value from expression): Area = Num1 +3
5) ( value from function) :Name= Sum(A,B)
6) (Value from Constant) : Area =3.14*R^2
Assignment Statement for Variables
Dim Number As Integer
Number = 500
Dim Number As Integer =500
1st
Case :(we can write the assignment statement after declaration line)
2nd
Case : (we can write the assignment statement during declaration in the same line)
Const Pi AS Single =22/7
Assignment Statement for Constants has One case:- must be during declaration only

More Related Content

PPTX
Visual Programming
PPTX
CHAPTER 2 (Data types,Variables) in Visual Basic Programming
PPTX
CHAPTER 3- Lesson A
PPT
Ch (2)(presentation) its about visual programming
PPTX
Visual Basic Fundamentals
PPT
Ppt lesson 05
PPT
Lesson 5 PP
PDF
Visual Basics for Application
Visual Programming
CHAPTER 2 (Data types,Variables) in Visual Basic Programming
CHAPTER 3- Lesson A
Ch (2)(presentation) its about visual programming
Visual Basic Fundamentals
Ppt lesson 05
Lesson 5 PP
Visual Basics for Application

Similar to different data types used in programming VB .pptx (20)

PPTX
Variables and calculations_chpt_4
PPTX
Chapter 03
PDF
Variables in Visual Basic Programming
PDF
VB PPT by ADI PART2.pdf
PDF
Visual basic
PPTX
Variable and constants in Vb.NET
PDF
VB PPT by ADI PART2.pdf
PPS
Visual Basic Review - ICA
KEY
.NET Variables and Data Types
PPT
Intro_to_VB.PPT
PPTX
COM 211 PRESENTATION.pptx
PPTX
PLF-Lesson tsu lecture time 2 units-2.pptx
PPT
Visual basic 6.0
PDF
Visual basic asp.net programming introduction
PPT
ملخص البرمجة المرئية - الوحدة الثالثة
PPTX
object oriented fundamentals in vb.net
PPTX
Vb ch 3-object-oriented_fundamentals_in_vb.net
PPTX
Unit 1 introduction to visual basic programming
PDF
vb.net.pdf
Variables and calculations_chpt_4
Chapter 03
Variables in Visual Basic Programming
VB PPT by ADI PART2.pdf
Visual basic
Variable and constants in Vb.NET
VB PPT by ADI PART2.pdf
Visual Basic Review - ICA
.NET Variables and Data Types
Intro_to_VB.PPT
COM 211 PRESENTATION.pptx
PLF-Lesson tsu lecture time 2 units-2.pptx
Visual basic 6.0
Visual basic asp.net programming introduction
ملخص البرمجة المرئية - الوحدة الثالثة
object oriented fundamentals in vb.net
Vb ch 3-object-oriented_fundamentals_in_vb.net
Unit 1 introduction to visual basic programming
vb.net.pdf
Ad

Recently uploaded (20)

PPT
“AI and Expert System Decision Support & Business Intelligence Systems”
PPTX
Big Data Technologies - Introduction.pptx
PDF
Assigned Numbers - 2025 - Bluetooth® Document
PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
PPTX
Programs and apps: productivity, graphics, security and other tools
PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
PDF
Dropbox Q2 2025 Financial Results & Investor Presentation
PPTX
A Presentation on Artificial Intelligence
PPTX
sap open course for s4hana steps from ECC to s4
PDF
Electronic commerce courselecture one. Pdf
PDF
Approach and Philosophy of On baking technology
PDF
Building Integrated photovoltaic BIPV_UPV.pdf
PPT
Teaching material agriculture food technology
PPTX
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx
PPTX
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
PDF
Machine learning based COVID-19 study performance prediction
PDF
Chapter 3 Spatial Domain Image Processing.pdf
PDF
Review of recent advances in non-invasive hemoglobin estimation
PDF
Empathic Computing: Creating Shared Understanding
PPTX
MYSQL Presentation for SQL database connectivity
“AI and Expert System Decision Support & Business Intelligence Systems”
Big Data Technologies - Introduction.pptx
Assigned Numbers - 2025 - Bluetooth® Document
Agricultural_Statistics_at_a_Glance_2022_0.pdf
Programs and apps: productivity, graphics, security and other tools
Digital-Transformation-Roadmap-for-Companies.pptx
Dropbox Q2 2025 Financial Results & Investor Presentation
A Presentation on Artificial Intelligence
sap open course for s4hana steps from ECC to s4
Electronic commerce courselecture one. Pdf
Approach and Philosophy of On baking technology
Building Integrated photovoltaic BIPV_UPV.pdf
Teaching material agriculture food technology
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
Machine learning based COVID-19 study performance prediction
Chapter 3 Spatial Domain Image Processing.pdf
Review of recent advances in non-invasive hemoglobin estimation
Empathic Computing: Creating Shared Understanding
MYSQL Presentation for SQL database connectivity
Ad

different data types used in programming VB .pptx

  • 2.  The Name: Text.  Birthdate: Date.  Gender: Boolean value.  Family members: numeric value
  • 6. Each data type has: 1. A storage space in the memory: such as (Integer) when used It occupies (4 bytes). 2- A range of values: minimum and maximum range of values type Ex: (Byte) starts with "0" and ends with "255".
  • 7. Constants and Variables Variables Constantans Defenition Are reserved Places in the computer 's memory that have Names and Data types that store values that can be changed during the execution of program Are reserved Places in the computer 's memory that have Names and Data types that store values that can not be changed during the execution of program Declaratio n Dim Dim Variable name As data Type Const Const constant name As Data Type = Value Ex Dim UserName As String Const Pi As Single =22/7
  • 8. Rules for naming the Constants and variables: : 1. names must begin with a letter or underscore (_). 2. names Should not contain symbols or special characters (e.g.: ?,*,^, -, +,.) 3. Variable names consist of letters, numbers, and underscores (_). 4. Do not use reserved words (Visual Basic.NET Language Keywords) such as (single, Dim, As). 5. It is preferable that the Variable name reflects its content.
  • 9. 1- Text valves are written between double quotes (" ") Const Cinema As string = "Royal" 2- (# #)are used while writing date or time. Const Birthdate As Date= #1/7/2011#  Assignment statement:
  • 10. Examples of values of assignment ststment 1) Abstract Value : Ex: Area =5 Text = "Egypt" 2) (Value from Variable ): Area = N1 3) (Value from Property): Name = TextBox1.Text 4) ( Value from expression): Area = Num1 +3 5) ( value from function) :Name= Sum(A,B) 6) (Value from Constant) : Area =3.14*R^2
  • 11. Assignment Statement for Variables Dim Number As Integer Number = 500 Dim Number As Integer =500 1st Case :(we can write the assignment statement after declaration line) 2nd Case : (we can write the assignment statement during declaration in the same line) Const Pi AS Single =22/7 Assignment Statement for Constants has One case:- must be during declaration only