Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Passing an array to a form
Message
 
À
29/06/1999 11:40:06
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00235291
Message ID:
00235350
Vues:
20
Hi John,

I do something that's pretty much what you're describing. I have a moverlist class that I instantiate like the following:
PUBLIC oBuilList
oBuilList=CREATEOBJECT('frmmoverlists',THISFORM,'abuilavail','abuilselected')
THISFORM passes an object reference of the instantiating form and abuilavail and abuilselected are array properties of the instantiating form. All three are stored to properties in my frommoverlists class called oRef, mcavail and mcselected. I then manipulate the calling forms arrays directly like in the following example:
mcavail=THISFORM.mcavail
mcselected=THISFORM.mcselected

DIMENSION THISFORM.oRef.&mcavail[1]
DIMENSION THISFORM.oRef.&mcselected[1]
THISFORM.oRef.&mcavail[1]=.F.
THISFORM.oRef.&mcselected[1]=.F.
HTH


>Hi gang!
>
>OK...have a situation that I could use some "been there, done that" advice on. I have a selection form and I'd like to store the selected values to an array. I'd like to create the array in the calling method and pass it to the form. I've tried:
>
>PUBLIC ARRAY aSelected[1]
>DO FORM frmSelector WITH @aSelected
>
>But it bombs. Doesn't like the Byref "@" sign. And I don't like the idea of declaring public memvars to begin with.
>
>Any suggestions on an alternative architecture? I have it working with PUBLIC ARRAY aSelected[1] and then hard-wiring the reference to aSelected in frmSelector but I don't like to hard-wire memvar references.
Colin Magee
Team Leader, Systems Development
Metroland Media Group Ltd.
Mississauga, Ontario, Canada

cmagee@metroland.com

Never mistake having a career with having a life.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform