Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Can SetAllX be used to call a method of a particular cla
Message
De
04/08/2007 13:30:19
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Classes - VCX
Versions des environnements
Visual FoxPro:
VFP 9 SP1
Divers
Thread ID:
01245942
Message ID:
01245959
Vues:
21
>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.

If all controls are direct controls of your form you could loop using controls collection, check if that method is defined on control, call the method and if returns false exit loop. Something like:
for each oControl in thisform.Controls
 if PemStatus( oControl, 'myMethod', 5 ) and ;
    lower(PemStatus( oControl, 'myMethod', 3)) == 'method' and ;
    !PemStatus( oControl, 'myMethod', 2)
    if !oControl.myMethod()
       exit
    endif
 endif
endfor
For a sample doing that on selected controls no matter how deep they are check foxyclasses' udfObjCollector ExecAll() sample.
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform