Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Array passed to form no longer an array
Message
From
18/04/2000 20:43:57
 
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00361069
Message ID:
00361122
Views:
22
Evan,

Here's my take on this, and of course a cheezy work-around. When you issue "Do ... with thisform.formproperty" the formproperty is passed by VALUE. When you pass an array by value, only the first element of the array gets copied and handed in; therefore the receiving parameter REALLY ISN'T AN ARRAY, but it's rather a SINGLE-VALUED-VARIABLE containing a COPY of the array's first element. You can verify this by putting a suspend after the parameters statement and take a peak at the parameter's value in the watch window. That's why you get the not an array error message (Foxpro's weak data typing is a a blessing as well as a liability).

You cannot use "set udfparams to reference" to override this behavior, nor does the @ sysmbol help when making the call in this way.

My Solution: make a copy of the array and pass the copy in by REFERENCE.

=acopy(thisform.aSearchFields, aMyTempArray)
DO FORM FIND WITH "device", aMyTempArray TO lnid

We're trading some memory for neatness of code, but it works.

Steve-O
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform