Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Exit command
Message
From
19/10/2002 11:43:25
 
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Miscellaneous
Thread ID:
00713159
Message ID:
00713191
Views:
22
Dennis-

>Is there an easy way to exit from a command button. What I would like to do is at the start of the code in a command button check to see if the user has entered the data needed to run the command. If not I just want to exit. Now I run a do case bu if I need to check several pieces of data it gets rather complex.

I have a slightly different take on this problem. Why let the user even click on the Exit button if the data isn't yet valid? This goes along with the idea that our responsibility is to help users make sensible selections and not make mistakes.

So, how to accomplish this depends on the interface, of course. But let's say two bits of information have to be entered before they can exit. You could bind the controls to form properties, and then, in the button's refresh() set the button's enabled to .T. or .F. depending on the values in the properties.

I'd also include a cancel button, if it makes sense for your app, that lets them close w/o having finished everything. You may already do this, but users should always have a way out other than CTL-ALT-Del.
Previous
Reply
Map
View

Click here to load this message in the networking platform