Notes week 03

Walter’s Teaching
Pages

Visual Basic – Class Notes – Week 03

Homepage ] Office Hours ] Class Listings ] Lab Schedule ] Student Login ] Some interesting links ]


Class notes: Visual Basic

Week: 3


Chapter 3 – Fundamentals of Programming in Visual Basic

3.2 Visual Basic Events

What is an event – pg. 58

Changing a property – pg. 59

Assignment operators

Types of properties

Properties of properties

Event Procedures – follow objectname_event() method of naming

Different event procedures – pg. 61

Comments on page 65

3.3 Numbers – pg. 71

Numbers are often used in computers

There are different types of numbers

Mathmatical vs. VB notation

Picture Boxes

  • Print
  • Cls

Scientific Notation – pg. 72

Variables – pg. 73

Assignment operator – pg. 74

Print Method – pg. 75, 76

Comments on Page 76

3.4 Strings – pg . 84

Strings are a sequence of characters that is
treated as a single unit.  They may include letters, numbers, spaces, and
all special charaters.

A String VARIABLE is used to reference a string – pg.
85

You assign a variable a string value like in this example: myStr =
"This is a string…"

Concatenation – combining two or more strings
together.  You use the "&" to concatenate strings
together. 

        Ex. bigString = str1 & str2

Declaring
Variable Types
– pg. 87

Use Dim to declare a variable, then state the
variables name As, then the variable type. 

        Ex: Dim myVariable As Single –
declares a variable which can hold single precision "real" i.e.
decimal numbers 

Using Text Boxes for Input/Output – pg. 88

  • To get a value from a Text Box into a Variable EX: newtext = txtInfo.Text
  • To put a value into a Text Box EX: txtInfo.Text = newtext
  • All values in a Textbox are strings.  
  • To convert from a string to a number, use val(), Ex. myNum =
    val(txtNum.Text)
  • To convert from a number to a string, use str(), Ex. txtNum.Text =
    str(myNum)

 


Copyright ©2001-2002, Walter Wimberly – Instructor and all
’round Cool Guy – IADT