>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