Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Property Arrays: Cannot pass by reference!!!
Message
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Property Arrays: Cannot pass by reference!!!
Miscellaneous
Thread ID:
00005499
Message ID:
00005499
Views:
75
Is it me, or does VFP not allow one to pass a property array by reference? Example:

Class definition:
Define Class myClass as Custom
Dimension AnArray(1)
EndDefine

Instantiation:
oMyObj=CreateObj("myClass")
* Assume that oMyObj.AnArray is redimensioned and filled in with something useful.

Later:
Do AnyProcedure with oMyObj.AnArray

In this situation, I have found there is no way to get VFP to pass the array by reference. Instead, it simply passes the fist element of the array. Set UDFParms and using "@" has no effect (in fact, you cannot use the "@" symbol when trying to pass an object reference).

This is really a nuisance because the receiving routine doesn't give a darn if the array is attached to an object variable or not. It simply wants an array by reference!

Is there a workaround? Thanks!
Next
Reply
Map
View

Click here to load this message in the networking platform