Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Returning an array from a form
Message
 
 
À
09/05/2000 15:49:49
Matt Trainor
Medical College of Georgia
Augusta, Georgie, États-Unis
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
00367796
Message ID:
00367821
Vues:
24
>I am trying to return an array from a form but after my form unloads, the array elements' values are all set equal to the first element value. I've messed with this in both vfp5 and vfp6sp3 without getting it to work. Knowing the array must be passed by reference, I have fooled around with SET UDFPARMS TO REFERENCE in the calling program and in the form's unload event before the return statement to no avail. I have tried DO FORM myform TO @aSelectedItems and get a syntax error in vfp5 and no change in vfp6sp3. I have tried RETURN @aSelectedItems and get a syntax error. Is there something I'm missing here or should I switch to a parameter object??
>
>Thanks in advance, Matt

Matt,
Just to throw my $0.02 in, use the paramter object concept. Unlike VB where you can assign an array as a return value, VFP can not return an array (no matter how many ways from Sunday you want to monkey with the syntax *s*).

You can either create the object before the form call and pass the object in and then store it in a form-level property (as Ed said) or you can have a form-level array property, work with it, create a custom object in the form's Unload event, add an array property to it using AddProperty (VFP 6), copy the form-level array to the object array and then return the new object. Either way is acceptable (IMO) but both require an object to hold the array.
Larry Miller
MCSD
LWMiller3@verizon.net

Accumulate learning by study, understand what you learn by questioning. -- Mingjiao
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform