Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
MESSAGEBOX
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Miscellaneous
Thread ID:
00365597
Message ID:
00366042
Views:
15
>Getting away from the MessageBox() in particular. How about these four for accessing the registry: HKEY_CLASSES_ROOT, HKEY_LOCAL_MACHINE, HKEY_CURRENT_CONFIG, HKEY_CURRENT_USER? Again, without looking them up, what are those values? I was able to sit here and type these out without looking to see what they the key names were. The values? I don't have a clue.

I store these values as protected properties of my registry access class, and never have to touch them outside the class.

Taking the argument a step further, and playing the devil's advocate, another coding practice I hear preached, and that is, user messages do not belong on code, they belong in include files, or message tables. The reasoning is: if the app ever needs to serve another language, only values in the include file or messaging table need be changed. This is a great reason to practice this. But I don't, for a couple of reasons.

Firstly, there is a 0% chance that most of my software will ever need to be used outside the US. The increased construction and maintenance time of removing all user messaging from the app is not worth it.

Secondly, often, a user gets a message from my application that doesn't explain a problem in terms they understand, or they get a message they don't think they should be getting. In either case, I need to get into my code to remember what causes the message, how it could be better worded, or whatever. Removing the message from the code makes it more difficult to locate the code. Also, user messaging in the code can serve as an additional code documentor. IOW, if I see a command at the top of a routine that says:

WAIT WINDOW "Creating index files..." NOWAIT

I know instantly what that routine is doing in the big picture. I don't even have to look at the comments.

Anyway, I know I have strayed way off the original subject, but I thought this was related...
Erik Moore
Clientelligence
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform