Article Preview
Buy Now
| Print: | |
| PDF: |
The Interface Designer
On Beyond MsgBox
Using REALbasic's customization routines to add a touch of class
Issue: 5.5 (July/August 2007)
Author: Toby Rush
Article Description: No description available.
Article Length (in bytes): 8,729
Starting Page Number: 46
RBD Number: 5517
Resource File(s): None
Related Link(s): None
Known Limitations: None
Excerpt of article text...
One of the benefits of using a high-level programming language like REALbasic is the availability of methods like MsgBox. With this command, it takes one simple line of code to display a dialog box for the user... something that lower-level languages might require dozens of lines of code to accomplish.
But MsgBox is not meant to be used in your finished project; it's a debugging tool. Before you compile your application in its final form, do a search for the text "MsgBox"... if it's in there even once, it means you still have some polishing to do. That's because dialog boxes -- windows which contain messages, warnings, questions or explanations for the user -- should be crafted with care, and MsgBox is not up to the task. For this situation as well as a few others, REALbasic has some more powerful routines that will help you do the job right.
Getting the Message Out
The tool that your application should use in place of MsgBox is the MessageDialog class. It requires a bit more work than MsgBox, but the corresponding increase in ease of use and professionalism for your program is immense. MessageDialog is a class, which means that you'll need to reserve a variable for it and then create a new instance of it in your code:
...End of Excerpt. Please purchase the magazine to read the full article.
Article copyrighted by REALbasic Developer magazine. All rights reserved.
|








