GRADE 9 COMSCIE
CISAT
VISUAL BASIC
• Is a third generation event-driven programming language first
released by Microsoft in 1991
• B – eginners
• A – ll purpose
• S - ymbolic
• I – nstruction
• C - ode
•Event – is an action recognized by control or form.
•Event driven Application – executeVisual Basic program in
response to an event.
•Object – is a simply a combination of program and data
that can be treated as a Unit form or a Button is an object.
•Variables – are memory location (address) within the
program module.
•Constants – Look like a variable, however unlike the
variable the value or data it holds remain fixed (while
application system is running or executing.)
The Legend of Val() and Str() Methods
• Value method ( val() ) and String Method ( str() )
• The val() Method converts the displayed data into numeric
• The str() method convert displayed data into string Data.
Visual Basic Arithmetic Operation
ADDITION (+) SUBTRACTION (-)
MULTIPLICATION (*) DIVISION (/)
INTEGER DIVISION () EXPONENTIATION (^)
MODULUS OPERATION (%)
Visual Basic Comparison & String Concatenation
Operator
• Is – if two object references refers to same object
• Like – perform string pattern matching
• & and + string concatenation
BASIC DATA TYPES OF VISUAL BASIC
DATATYPE PURPOSE
Integer
An integer data type is a whole number.This values could
be positive or negative and traditionally holds values in
the range of : -32,768 to 32,727
Ex: 9 143 3200
Long
A bigger integer means a wider range of integer
Ex: 100,123 1,000,000 33,200
Single
A number with fractional part or decimal point and holds
values up to 3402823E+38 or 34 to the 38th power
Ex: 3.1416 2.54 193.20
Double
A number w/ fractional part or decimal point holds up to
1.7976931348623D+ 308 or 18 times to the 308th power
Ex: 1143441000.5121 1000000000.151314
DATATYPE PURPOSE
String
A sequence of one or more character that are enclosed
within double quotation marks.
Ex : “A” “Hello” “World”
“HelloWorld”
Boolean
A data type that holds true or false values
Ex: if 13>10 then
answer = yes
end if
Byte
A small integer data type with a range of 0 to 255
Ex: 6 254 100 120 199
Date
For Date values data type
Ex: Birthdate = #Sept – 12- 82 #
Birthdate = #Mar – 7- 1982 #
Birthdate = #17 October 1997 #

Grade 9 COMPUTER

  • 1.
  • 2.
    VISUAL BASIC • Isa third generation event-driven programming language first released by Microsoft in 1991 • B – eginners • A – ll purpose • S - ymbolic • I – nstruction • C - ode
  • 3.
    •Event – isan action recognized by control or form. •Event driven Application – executeVisual Basic program in response to an event. •Object – is a simply a combination of program and data that can be treated as a Unit form or a Button is an object. •Variables – are memory location (address) within the program module. •Constants – Look like a variable, however unlike the variable the value or data it holds remain fixed (while application system is running or executing.)
  • 4.
    The Legend ofVal() and Str() Methods • Value method ( val() ) and String Method ( str() ) • The val() Method converts the displayed data into numeric • The str() method convert displayed data into string Data.
  • 5.
    Visual Basic ArithmeticOperation ADDITION (+) SUBTRACTION (-) MULTIPLICATION (*) DIVISION (/) INTEGER DIVISION () EXPONENTIATION (^) MODULUS OPERATION (%)
  • 6.
    Visual Basic Comparison& String Concatenation Operator • Is – if two object references refers to same object • Like – perform string pattern matching • & and + string concatenation
  • 7.
    BASIC DATA TYPESOF VISUAL BASIC DATATYPE PURPOSE Integer An integer data type is a whole number.This values could be positive or negative and traditionally holds values in the range of : -32,768 to 32,727 Ex: 9 143 3200 Long A bigger integer means a wider range of integer Ex: 100,123 1,000,000 33,200 Single A number with fractional part or decimal point and holds values up to 3402823E+38 or 34 to the 38th power Ex: 3.1416 2.54 193.20 Double A number w/ fractional part or decimal point holds up to 1.7976931348623D+ 308 or 18 times to the 308th power Ex: 1143441000.5121 1000000000.151314
  • 8.
    DATATYPE PURPOSE String A sequenceof one or more character that are enclosed within double quotation marks. Ex : “A” “Hello” “World” “HelloWorld” Boolean A data type that holds true or false values Ex: if 13>10 then answer = yes end if Byte A small integer data type with a range of 0 to 255 Ex: 6 254 100 120 199 Date For Date values data type Ex: Birthdate = #Sept – 12- 82 # Birthdate = #Mar – 7- 1982 # Birthdate = #17 October 1997 #