Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Object Reference
Message
De
27/12/2007 00:40:23
Dragan Nedeljkovich (En ligne)
Now officially retired
Zrenjanin, Serbia
 
 
À
26/12/2007 19:34:45
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivie
Information générale
Forum:
Visual FoxPro
Catégorie:
Programmation Orientée Object
Versions des environnements
Visual FoxPro:
VFP 8 SP1
Divers
Thread ID:
01277566
Message ID:
01277685
Vues:
17
>>How can I have a reference to an object like this?
>>
>>
>>loLine = 'loLine' + ALLTRIM(STR(ix))
>>&loLine = LineToObject(laLines[m.ix])
>>
>>
>>So that I can reference loLine5.Property if ix = 5 ?
>>
>>The above doesn't work.
>
>This looks suspiciously as if you want to maintain an array of objects - something people sometimes need on a form.
>
>My personal preference would be to add an array of objects to the form, with .AddObject(). See my FAQ #8110. Once created, you can access any one of the objects with array syntax! Note that some of the greatest experts over here don't agree with my preference; but the FAQ also includes other alternatives.

You may want to update the FAQ, with two things. First, we now also have an option to have a collection of objects, which gives us two ways of accessing the members at random - by number (same as arrays) and by key (arrays can't do that without writing a loop or carefully designing aScan() check), and there's the same For Each option that works for arrays.

The other thing you need to update is the link to the thread - UT has changed link formats so your link doesn't work anymore.

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