8/3/2019 Visual Basic Data Types, Modules and Operators
1/13
8/3/2019 Visual Basic Data Types, Modules and Operators
2/13
8/3/2019 Visual Basic Data Types, Modules and Operators
3/13
8/3/2019 Visual Basic Data Types, Modules and Operators
4/13
Code in Visual Basic is stored in the form of modules. The of modulthree kind es are FormModules, Standard Modules and Class Modules.
A simple application may contain a single Form,and the code resides in that Form module itself.As the application grows, additional Forms areadded and there may be a common code to be
executed in several Forms. To avoid theduplication of code, a separate modulecontaining a procedure is created thatimplements the common code. This is astandard Module.
8/3/2019 Visual Basic Data Types, Modules and Operators
5/13
8/3/2019 Visual Basic Data Types, Modules and Operators
6/13
2.StringA sequence of one or more characters that are enclosed withindouble quotation marks ( a Z Anne *)
3.Date
For date values data type ( Birthdate = #Sept-12-87# )4.BooleanBoolean data types hold either a true or false value. Values areinternally stored as -1 (True) and 0 (False) and any non-zero valueis considered as true.
5.Decima
lRefers to any large numerical value whether it is an integer orfloating point.
6.ObjectRefers to objects within Visual Basic application or otherapplication ( Dim objDb as Object)
8/3/2019 Visual Basic Data Types, Modules and Operators
7/13
Arithmetic
Operators Description Example Result
+ Add 5+5 10
- Substract 10-5 5
/ Divide 25/5 5
\ Integer Division 20\3 6
* Multiply 5*4 20
^ Exponent (power of) 3^3 27
Mod Remainder of division 20 Mod 6 2
& String concatenation "George"&" "&"Bush""George Bush"
8/3/2019 Visual Basic Data Types, Modules and Operators
8/13
Relational
Operators Description Example Result
> Greater than 10>8 True
< Less than 10= Greater than or equal to 20>=10 True
8/3/2019 Visual Basic Data Types, Modules and Operators
9/13
Logical
Operators Description
OROperation will be true if either of the
operands is true
ANDOperation will be true only if both the
operands are true
8/3/2019 Visual Basic Data Types, Modules and Operators
10/13
What are the programming fundamentals of
visual basic?
How important are those in designing and
developing an application program?
Using the Addition Calculator Application,explain how the programming fundamentals
are applied in the design of the application.
8/3/2019 Visual Basic Data Types, Modules and Operators
11/13
A. Identify which does not belong to the group.
___1. a. string b. long c. variant d. Date
___2. a. quadruple b. double c. single d. Currency
___3. a. boolean b. date c. arithmetic d. String___4. a. greater than b. OR c. ampersand d. Integer
___5. a. arithmetic b. declaration c. logical d. Relational
___6. a. True b. AND c. $ d. *
___7. a. @ b. % c. # d. 6___8. a. procedure b. form c. class d. Standard
___9. a. 2^2 b. 5*3 c. 7 mod 2 d. 10 %
___10. a. and b. * c. & d. mod
8/3/2019 Visual Basic Data Types, Modules and Operators
12/13
Value DataType
1. True2. 200
3. +1434. 33,0005. 3.1416
6. -15
8/3/2019 Visual Basic Data Types, Modules and Operators
13/13
Thank You