Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Array passed to form no longer an array
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
00361069
Message ID:
00361207
Vues:
26
>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
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform