Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Can SetAllX be used to call a method of a particular cla
Message
General information
Forum:
Visual FoxPro
Category:
Classes - VCX
Environment versions
Visual FoxPro:
VFP 9 SP1
Miscellaneous
Thread ID:
01245942
Message ID:
01246022
Views:
23
This message has been marked as a message which has helped to the initial question of the thread.
>Hi all
>
>I wanted to loop through all controls on a form and if an instance of a particular class is found I wanted a method of this class to be executed, can SetAllX do this?
>
>Further, this called method will return a logical value depending on which I want the calling code to stop further processing, so out of multiple instances even if one of them returns a .F. I want the calling code to stop executing. So is it possible to get a list of return values from SetAllX?
>
>Please advise.

Here is an idea I learnt from Tray Walpole 7 or more years ago.

Give the classes you want to execute your method two new properties, say, lExecuteMethod the form may have lStopExecution property


Give lExecuteMethod property an assign method with something like
lparameters tuNewVal
if m.tuNewVal
   if not thisform.lStopExecution
        thisform.lStopExecution = this.ExecuteSomeMethod()
   endif
endif
So now you can try

thisform.SetAll('lExecuteMethod',.t.) when you need to execute some method. Note, that you may have different code and different methods to be executed using this technique.
If it's not broken, fix it until it is.


My Blog
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform