Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Array passed to form no longer an array
Message
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00361069
Message ID:
00361207
Views:
29
>I have pass a 2D array to a form with the following command.
>
>DO FORM FIND WITH "device", thisform.aSearchFields TO lnid
>
>In the INIT of the modal I have the parameter statement.
>PARAMETERS lcTable, laFields
>
>laFields appears to only by a character type. Referencing laFields(1,1) throws an error that the item is not an array

Evan,

The problem here is that the Init cannot resolve object reference. The form receiving the array expects just an array not an array that's a property of an object. We've seen a number of these sorts of problems. The solution is either to copy the array prior to the call and pass the copy or pass the object. In the latter case, of course, you'll have to properly reference the property name, which increases coupling.

As a side note, as others have mentioned arrays have to be passed by reference. However, anytime DO is used (including this case) the array is passed by reference so using the @ symbol isn't necessary.
George

Ubi caritas et amor, deus ibi est
Previous
Reply
Map
View

Click here to load this message in the networking platform