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. Which errors are the easiest to find?
  2. Which errors are the hardest to find?
  3. If you write a program and, during execution, the program halts and displays an error message telling you that a disk drive doesn't exist, what kind of error just occurred?
  4. How can you tell the current program mode?
  5. What is a breakpoint?
  6. What are three things you can do at a breakpoint?
  7. How do you single-step through a program?
  8. True or false: While using the debugger, you have no access to your program's Output window.
  9. What's the quickest way to see a variable's value at a breakpoint?
  10. What method displays values in the Immediate window?

Exercises

  1. Larry the Visual Basic programmer wants to send values to the Immediate window right before he reads a disk file. Here are some statements Larry uses to print to the Immediate window:

    Print lblFileName.Caption
    Print intNumRecs, intNumFields
    Print strCompName
    

    Larry isn't having success. Instead of the Immediate window, these values all seem to appear on the form itself! Help determine what Larry is doing wrong so he can view the values in the Immediate window.

  2. Load the Controls.vbp sample project. Single-step through the project beginning at a breakpoint that you set in Form_Load()'s last statement. The program uses data in a different way than normal because the program uses a resource file to hold its strings. By moving all its data out to a resource file, the strings can be easily translated to other languages, and the program only needs to be recompiled. Without a resource file, a programmer would have to search the Code window for all strings and possibly miss some. Use the single-step mode to learn how the resource file and its related built-in functions operate.

Share ThisShare This

Informit Network