Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Generic code to find object in form
Message
De
01/09/2008 15:14:26
Dragan Nedeljkovich (En ligne)
Now officially retired
Zrenjanin, Serbia
 
 
À
01/09/2008 13:44:09
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP2
Divers
Thread ID:
01343851
Message ID:
01343880
Vues:
17
>Hi,
>
>
>I am 'fighting' with the code to construct a generic search method to find for and get the value of a given property on a form.
>
>The Object's Hierarchy can be in a container or in a Page or even in a Page on a Page e.s.o.
>Once the value of that Property is given, the form should act upon this value.
>Now either I shall have to for/next through all my objects on the form - this could than eventualy turn into a very slowing thing since you can expect 200+ objects on the form. Alternatively I could do the for/next loop only once, at init, load the value into a array and just query that array, making the loop remarkably smaller and thus quicker. Obviously this array should be updated on the moment the property's value is changed but that is easy enough handled with an extra property on the object.
>Now be4 reinventing the wheel. Do we have knowledge of any such class?

Look up my recurser class (just click on my name, then contributions). I once used it to build such an array of object references (using sys(1272) without the first word - which is bogus until form.init() exits, but can be eval()ed later within with thisform - endwith block), and only the objects I actually wanted. In your cases, objects which have the property - skip all the shapes, labels etc.

back to same old

the first online autobiography, unfinished by design
What, me reckless? I'm full of recks!
Balkans, eh? Count them.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform