Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Select Commandbuttom with caption
Message
From
23/09/2005 12:03:36
 
 
To
23/09/2005 06:30:36
General information
Forum:
Visual FoxPro
Category:
Other
Environment versions
Visual FoxPro:
VFP 6 SP3
OS:
Windows '98
Network:
Windows 98
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01052280
Message ID:
01052417
Views:
14
>I want to click button that has caption "Mango".
>How is it possible programatically?

>
>In addition to what Hilmar has told you, it is much better programming practice to code in methods, not events. What this means is that you really should create a custom form method and call that method from the click of the command button and anywhere else you need to execute the code.

Let's say that I have a button on the form which runs a validation routine. I really need to have that routine run at least once every hour. So I add a form property ValidationLastRunTime and put code to reset that property in the button click() event. Then I add a timer control which compares current time with last run time and executes button.click() if needed.

I think you are saying that it would be better practice to move all the code from button.click() into a custom form method and have both the button and the timer call that method.

If not, could you please explain what I've missed?

If so, I don't doubt your assertion, but I also don't see any practical difference. Could you explain what makes this better coding practice?

Thanks..........Rich
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform