Chapter 9 Trapping Errors by Using Structured Error Handling 241
- Click the Check Drive button.
The error handler displays the error message “Please insert the disc in drive D!”
in a message box, as shown here. Behind the scenes, the Retries variable is also
incremented to 1.
- Click OK, and then click the Check Drive button again.
The Retries variable is set to 2, and the message “Please insert the disc in drive D!”
appears again.
- Click OK, and then click the Check Drive button a third time.
The Retries variable is incremented to 3, and the Else clause is executed. The message
“File Load feature disabled” appears, as shown here:
- Click OK in the message box.
The Check Drive button is disabled on the form, as shown here: