MsgBox()'s Return ValueThe reason that you assign MsgBox() functions to variables is so you can tell which button the user presses. Suppose that the user clicked the Yes button in Figure 6.4. The program could then print the report. If, however, the user clicked the No button, the program could describe what the user needed to do to get ready for the report (load paper, turn on the printer, and so on). If the user pressed the Cancel button, the program would know that the user didn't want the report at all. Table 6.4 lists the seven possible MsgBox() return values. You can test either for the integer or the named literal return value. Table 6.4. MsgBox() return values.
|
|||||||||||||||||||||||||
![]() |
![]() |
|||