Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
MESSAGEBOX
Message
 
To
04/05/2000 09:16:12
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Miscellaneous
Thread ID:
00365597
Message ID:
00366062
Views:
16
Hi Erik,

>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.
>

Add to that "Speiling Erors", which I make a lot of ;). If all the strings are in a single .h file, you can run a spell checker on 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,

But you can still look it up in the .h, then go find the constant. It's an extra step but IMO worth it. Keeping them as contants I can resuse the same messages in different places in the code and maintain a better consistency in what the user sees.

>WAIT WINDOW "Creating index files..." NOWAIT

-or- WAIT WINDOW MSG_CREATING_INDEX NOWAIT

I have a bunch similar to this:

#DEFINE MSG_FEE_NOT_0 "The Fee can't be $ 0.00 or a negative number."

The constant name is pretty obvious and I use it in a bunch of different places to validate user input. If I ever want to change the actual message string I change it in 1 place, I don't have to go searching through the code.
Roi
'MCP' Visual FoxPro

In Rome, there was a poem.
About a dog, who found two bone.
He lick the one, he lick the other.
He went pyscho, he drop dead!
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform