CSC 430 - Review for Quiz 1

Schneider Book - Intro to VB6.0


Chapter 3 -

bulletobjects
bulletevents
bulletnumbers
bulletstrings
bulletI/O
bulletfunctions

Chapter 5

bulletIF
bulletSELECT-CASE

Chapter 6

bulletDO
bulletFOR-NEXT

Chapter 7

bulletArrays
bulletControl Arrays

Chapter 11

bulletFrames
bulletCheck Boxes
bulletOption/Radio Buttons
bulletScroll Bars
bulletTimer Control
bulletCommon Dialog Control

Chapter 3 -

bullettext box - used to get data from user
bulletlabels - to explain what another control is for; to also display output
bulletcommand button - clicked to initiate an action
bulletcaption property - displayed on a control
bulletname property - reference to the control in VB code
bulletevent - mouse click or key press
bulletFormat of statements using VB objects:  objectname.property = value
bulletevent procedure - statements executed when an event occurs
bulletnumeric operations: +, -, *, /, ^
bulletstrings: " ... " (a double-quoted set of characters)
bulletconcatenation operator: + or &
bulletdata types:
bulletdim x as ---
bulletinteger
bulletsingle
bulletlong
bulletdouble
bulletcurrency
bulletvariant
bulletimportant conversions:
bulletdim s as string
bulletdim n as integer
bulletn = val(s)
bullets = str(n)
bullets = chr(n) 
bulletn = asc(s)  '1st char of string only
bulletSequential I/O:
bulletopen filename for [input|output|append] as #n
bulletinput #n,var1,var2,... 'inputs separated by commas or newline
bulletprint #n,var1;var2;... 'no whitespace on output
bulletclose #n
bulletFunctions:
bulletdim s as string
bullets = inputbox(prompt, title)
bulletcomments: begin with an '
bulletString Functions:
bulletleft
bulletmid
bulletright
bullettrim
bulletUCase
bulletlen
bulletinstr(string1, string2) :
bullet=0 if string2 is not contained within string1
bullet=1st position of string2 within string1
bulletformatting:
bulletformatnumber(12345.628,1) => 12,345.6
bulletformatcurrency(12345.628,2) => $12,345.63
bulletformatpercent(0.185,2) => 18.50%
bulletformat( time, "hh:mm:ss")
bulletRandom:
bulletRandomize : to seed the random number generator differently each time
bulletRnd to yield a random number >=0 and < 1

Chapter 5 -

IF Forms:

bulletIF condition THEN
   actions
ELSE
   actions
END IF
bulletIF condition THEN
  actions
ELSEIF condition
  actions
ELSEIF condition
  actions
ELSE 
  actions
END IF

SELECT CASE FORM:

bulletSELECT CASE variable
 CASE value1
  actions
 CASE value2,value3
  actions
 CASE value4 to value5
  actions
 CASE Is > value
  actions
END SELECT

Chapter 6

bulletDO WHILE (condition)
  actions
LOOP
bulletDO
  actions
LOOP UNTIL (condition)
bulletEOF(n) - returns true if file #n is positioned at the End-of-File
bulletDIM X AS BOOLEAN  'x can be either TRUE or FALSE
bulletFOR I = startingValue TO endingValue STEP increment
  actions
NEXT I

Chapter 7

bulletArrays:  Dim array(1 to n) as datatype  ' yields exactly n items in the array; the index goes from 1 to n
bulletControl Arrays:  index property of the control = 0 (blank means it's not a control array)
bulletRefer to example on page 343 using the 'month' control array
bulletDynamic Arrays:
bulletDim x() as datatype  'in general declarations
bulletRedim x(1 to n) as datatype  'in any procedure
bulletRedim PRESERVE x(1 to m)   'will try to keep the old values of x on a Redim request

Chapter 11

bulletFrames - creating the control first and then dragging it into a frame is bad
bulletCheck Box - more than one can be selected;  possible values:
bullet.value = 0 => not checked
bullet.value = 1 => checked
bullet.value = 2 => greyed out
bulletOption/Radio Button - possible values
bullet.value = TRUE | FALSE
bulletYou can set the .value to FALSE and it will 'unmark' the control
bulletScroll Bars: key properties -
bulletmin (for left and top)
bulletmax (for right and bottom)
bulletvalue
bulletSmallChange
bulletLargeChange
bulletTimer :  key issues -
bullet.enabled = TRUE | FALSE
bullet.interval => set to a time value in milliseconds (1000 = 1 second)
bulletCommon Dialog Control
bulletFilter
bulletShowOpen
bulletShowSaveAs


Designed by Dr Bernie - Last updated on Wednesday, February 18, 2009