Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Determine if WAIT message is displayed?
Message
General information
Forum:
Visual FoxPro
Category:
Other
Environment versions
Visual FoxPro:
VFP 9
Miscellaneous
Thread ID:
01516514
Message ID:
01516950
Views:
77
I'm with Dragan on this: You shouldn't put your logic in the middle of the data code - the message should be externally handled even if it's just another wrapper function that handles this.

Given that I would use a default message if none is supplied and override only in special cases (which hopefully are few). But in that case you need to trigger that externally anyway.

FWIW, it's a good idea to manage message display through a central function/method anyway. this way you're always calling the same routine for all message displays. Most of the classes I build have a StatusMessage() method to which I can pass messages which usually defaults to wait window operation. But if necessary that method can be overridden and use some other message output mechanism or none at all (by overriding with no code executing at all). In that code you could also keep track of the status of the message...

If you really need something that can detect if it's running - use some other mechanism like a custom window and check to see if that window is instantiated or visible.


+++ Rick ---

>>>Not a stupid question; rather valid one. Here is why. I have a generic routine that calls SQL Server to get some records (basically executing SQLEXEC()). This function has a "generic" WAIT statement. But sometimes I want the routine (function/method) that call this generic function to have a more specific WAIT statement. So my thought was that in the generic function I could "check" to see if a WAIT statement already displayed and not to display another one.
>>
>>Why can't you do that right inside that function? I mean, the wait command. Instead of issuing the wait where you do now, pass its content to this function and let it handle the cases. That way you have all your related waits (except Tom) in one place.
>
>I see what you are saying. This is a valid approach but the downside is that I would have to add this parameters in million places where the function is being used. I dón't think it is worth all these troubles. If I can't determine that WAIT already exists, one "generic" will be displayed.
>Thank you for your suggestion.
+++ Rick ---

West Wind Technologies
Maui, Hawaii

west-wind.com/
West Wind Message Board
Rick's Web Log
Markdown Monster
---
Making waves on the Web

Where do you want to surf today?
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform