Sams Teach Yourself Visual Basic 6 in 24 Hours

Sams Teach Yourself Visual Basic 6 in 24 Hours

By Greg Perry

Workshop

The quiz questions and exercises are provided for your further understanding. See Appendix B for the answers.

Quiz

  1. What are two reasons for writing structured programs?

  2. True or false: Structured code is useful for getting to code details as fast as possible.

  3. True or false: You can write your own functions.

  4. What is wrong with the following subroutine declaration?

    Public Subroutine DoItSub ()
    
  5. When is the Call keyword optional in subroutine calling?

  6. The following code appears in a form module's general section. Is X a local, module-global, or project-global variable? What about Y? Would your answers be different if this appeared in an external module as opposed to a form module?

    Dim X As Integer
    Public Y As Integer
    
  7. What is wrong with the following function declaration?

    Public Function DoCalc(intAge As Integer, strCoNames(45) As String)
    
  8. Why does the called procedure need to know the datatypes for passed values?

  9. How does one procedure get local data from a calling procedure?

  10. Which keyword is optional: ByRef or ByVal?

Exercises

  1. Write a general-purpose standard function procedure that accepts a numeric integer argument and returns that argument multiplied by 10.
  2. Write a standard subroutine procedure that accepts three single-precision arguments and displays those three values in labels named lblSng1, lblSng2, and lblSng3.

Share ThisShare This

Informit Network