Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Objects, Arrays & parameters
Message
From
23/06/2002 20:51:50
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00671447
Message ID:
00671519
Views:
15
Hi Sergey

Actually, in this instance it always was as it was part of my class.

The real problem was that my code was in the wrong class.

I have now fixed (encapulated) my code to make passing by reference unnecessary.

Thanks to all for your help
Regards
Geoff Scott

>>Further to my last message, one can construct one's own reference and pass that.
>
>Sorry to disappoint you but what you're passing isn't a reference but the full name of the array property. It would only work if the object, array property belongs to, is in the scope in the function. Here's the test code that demonstrates that.
*LOCAL loObj
>PRIVATE loObj
>loObj = Createobject("Custom")
>loObj.AddProperty("aArray[3]",3)
>? myfunc("loObj.aArray")
>RETURN
>
>FUNCTION myfunc(caArray)
>RETURN &caArray[2]
>
With PRIVATE loObj it works but uncommenting LOCAL loObj'll generate an error because loObj isn't in the scope in the myfunc function.
>
>So, no hum. :)
May all your weeds be wildflowers
Previous
Reply
Map
View

Click here to load this message in the networking platform