Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Object Reference
Message
From
27/12/2007 00:40:23
Dragan Nedeljkovich (Online)
Now officially retired
Zrenjanin, Serbia
 
 
To
26/12/2007 19:34:45
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivia
General information
Forum:
Visual FoxPro
Category:
Object Oriented Programming
Environment versions
Visual FoxPro:
VFP 8 SP1
Miscellaneous
Thread ID:
01277566
Message ID:
01277685
Views:
18
>>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.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform