Vous êtes sur la page 1sur 16

Variables in VB.

Net
Arian M. Edullantes, MMITM, MMEPM
Teacher in Charge
Lesson Objectives

At the end of the lesson, 85% of the students should be able:


To name variables in VB.NET program properly
To identify and use variables correctly
To understand the importance of variables in a program
Simple Recall

All programs revolve on a data; either needs one or generates one.

Data
A set of values, needed or generated, in a program.
Can be of any type: letters, numbers, symbols, objects

Data Type
The kind of data it can hold and how data is stored.
The classification identifying one of various types of data
Examples: Integer, Decimal, String, Char, Date, Boolean, etc.
Where were data stored?

Variables
Variables

Much like a container


Determined by the type of data that it can store
Variable Name

1. Must not be a Key Word or Reserved Words


Class, Public, Exit (all words that turns blue in VB.Net when coding)
2. Must only be one word, no space allowed.
3. Must not begin with special characters or numbers.
4. Must at least have meaning to the stored data. Avoid using only single letter.
Num1, Fname, Sum
Lets see how you learn.

Valid Invalid DepT_Educ

2s0d1h6

family name

#Hugot

answer

Exit

CompleteName
Lets see how you learn.

Valid Invalid DepT_Educ

DepT_Educ 2s0d1h6

family name

#Hugot

answer

Exit

CompleteName
Lets see how you learn.

Valid Invalid DepT_Educ

DepT_Educ 2s0d1h6 2s0d1h6

family name

#Hugot

answer

Exit

CompleteName
Lets see how you learn.

Valid Invalid DepT_Educ

DepT_Educ 2s0d1h6 2s0d1h6

family name family name

#Hugot

answer

Exit

CompleteName
Lets see how you learn.

Valid Invalid DepT_Educ

DepT_Educ 2s0d1h6 2s0d1h6

family name family name

#Hugot #Hugot

answer

Exit

CompleteName
Lets see how you learn.

Valid Invalid DepT_Educ

DepT_Educ 2s0d1h6 2s0d1h6

answer family name family name

#Hugot #Hugot

answer

Exit

CompleteName
Lets see how you learn.

Valid Invalid DepT_Educ

DepT_Educ 2s0d1h6 2s0d1h6

answer family name family name

#Hugot #Hugot

Exit answer

Exit

CompleteName
Lets see how you learn.

Valid Invalid DepT_Educ

DepT_Educ 2s0d1h6 2s0d1h6

answer family name family name

CompleteName #Hugot #Hugot

Exit answer

Exit

CompleteName
Remember

Every data, either inputted to or generated by the program, needs a


container called Variables, in programming.
There is a correct way in naming variables.
Not a Key/Reserved Word
No space allowed
Start with letters
At least have meaning to the data stored

Vous aimerez peut-être aussi