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

Click here to load this message in the networking platform