Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Returning an array from a form
Message
De
09/05/2000 17:45:26
 
 
À
09/05/2000 17:36:23
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
00367796
Message ID:
00367874
Vues:
20
>Thanks. Is that something like the following?
>Public array myarray[5,5]

Nope - this does not involve creating a PUBLIC array.

>do form with thisform
>
>*in the new form
>In the init
>
>thisform.passed_array = thisform.myarray
>
>John

In the new form:

In the basic form DEFINE, implemented at Load:

oPassedObject = NULL

In the Init:

LPARAMETER oParmObject
thisform.oPassedObject = oParmObject

anywhere in the form, you reference the parameter object as thisform.oPassedObject.MyArray[] whenever need - it can be resized, have values read and written, etc.

To call it:

oObjToPass = CREATEOBJ('Line') && or whatever
oObjToPass.AddProperty('MyArray[5,5]') && whatever size is needed
*
* Populate the array member of oObjToPass as you like
*
DO Form whatever WITH oObjToPass

This mechanism doesn't screw up as the public array would when >1 instance of the Form might exist, and doesn't break encapsulation or create any dependencies on the name of the array. It works with both modal and non=modal forms.
EMail: EdR@edrauh.com
"See, the sun is going down..."
"No, the horizon is moving up!"
- Firesign Theater


NT and Win2K FAQ .. cWashington WSH/ADSI/WMI site
MS WSH site ........... WSH FAQ Site
Wrox Press .............. Win32 Scripting Journal
eSolutions Services, LLC

The Surgeon General has determined that prolonged exposure to the Windows Script Host may be addictive to laboratory mice and codemonkeys
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform