Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Passing an array property by reference
Message
From
23/11/1997 03:12:44
Dragan Nedeljkovich
Now officially retired
Zrenjanin, Serbia
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00060585
Message ID:
00061805
Views:
66
>>Yes, but how can you send a property by reference to a function? >> >>Vlad > >My guess is that you'd send a reference to the object to the >function and let it work on what every it needed to. > >Steve You'd have to make a workaround, if you wanted to have a generalized function - you'd have to pass the object reference and property name, and the function would have to work with a lot of macro substitutions or name expressions, like Lparam oRef_lp, ArrName_lc store "something" to ("oRef_lp."+ArrName_lc+"[1]") ... Kind of kludgy, but feasible. I've tried this: a command2 button with this in .click:
thisform.chglabel(thisform, "controls")
and this is the chglabel method
Lpara oRef, propname
with thisform.label1
    .caption=eval("oref."+propname+"[1].name")
When I click on command button, the label's caption changes into "command1". Maybe we could do
Local array something_la
=acopy(&("oref."+propname), something_la)
....work with something_la
=acopy(something_la, &("oref."+propname))
....but then it means copying arrays (and I haven't tried that, might be no good at all), and we wanted referrence, right?

back to same old

the first online autobiography, unfinished by design
What, me reckless? I'm full of recks!
Balkans, eh? Count them.
Previous
Reply
Map
View

Click here to load this message in the networking platform