0% found this document useful (0 votes)
37 views

Visual Basic Fundamentals-I

This document provides an introduction to programming in Visual Basic (VB), including an outline of topics covered and an overview of variables. It discusses VB variable naming conventions and data types, noting that variables must be declared with a data type using the "Dim" statement. The document provides examples of different data types, including numeric (integer and floating point), string, and character types.

Uploaded by

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

Visual Basic Fundamentals-I

This document provides an introduction to programming in Visual Basic (VB), including an outline of topics covered and an overview of variables. It discusses VB variable naming conventions and data types, noting that variables must be declared with a data type using the "Dim" statement. The document provides examples of different data types, including numeric (integer and floating point), string, and character types.

Uploaded by

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

Programming in VB

Tahir Mahmood

1
Outline

2
Introduction to VB

3
Variables
 A variable is an area of computer memory
you use in your program.
 To use a variable, you must give it a name.
 There are rules you should, and usually
must, follow when naming your variables.

4
Variable naming conventions
 Must begin with a letter.
 Cannot have a period (remember that we use the period
to set a property; in other words the period is an
operator)
 Can have up to 255 characters. Please, just because it is
allowed, don't use 255 characters.
 Must be unique inside of the procedure or the module it
is used in (we will learn what a module is)
 Once a variable has a name, you can use it as you see
fit. For example, you can assign it a value and then use
the variable in your program as if it represented that
value.
5
 Before declaring or using a variable, first decide what
kind of role that variable will play in your program.
Different variables are meant for different situations. The
kind of variable you want to use is referred to as a data
type. To specify the kind of variable you want to use, you
type the As keyword on the right side of the variable's
name. The formula to declare such a variable is:

 Dim VariableName As DataType


6
7
8
9
10
Kinds of Data - Practice
Data Type
If kind is ‘numeric’, then
1. 17 is it an integer or a
floating point number?
2. “George”
3. 2.35
4. 0.0023
5. -25
6. ‘m’
7. 4.32E-6
8. “185.3”
9. 0
10. 1
11

You might also like