Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Memory variables and forms
Message
 
À
06/06/1996 11:41:22
John Onysko
1 Edi Source, Inc.
Hudson, Ohio, États-Unis
Information générale
Forum:
Visual FoxPro
Catégorie:
Problèmes
Divers
Thread ID:
00001959
Message ID:
00002033
Vues:
29
>>>Create a form array property! In the Form Menu
>>>choose Property & enter (ie:) aMyArray[1,1]
>>>(And of
>>
>>
>>Another alternative is to initialize you
>variables
>>(or arrays)
>>as public! This will make them visible to all
>>methods associated
>>with your form.
>>
>>BTW, Tom's approach is the more correct OOP way
>of
>>doing it!
>>
>>John
>Thanks guys. I had gotten the form to work with
>public variables, but I was not happy with the
>fact that I had to release all variables in the
>unload procedure. Also, I was kind of dreading
>putting every variable that I want to use into the
>form's properties. My application uses a LOT of
>variables. Oh well, I guess I'll have to bite the
>bullet and use the properties!
>

John

I try & keep it all Generic. IE I am never sure what vars will be passed to a Form after it has been around awhile (I build form Templates). So I pass 'a' array as the parameter. In the INIT I loop through the array & load (get) what I need and discard the rest. My column 1 position is the Data, Column 2 is the 'tag' of the Data. If I load form properties from the array I make the tag & property names the same (saves confusion). If the INIT receiving it is subcalssed the be sure to do this:

MyFrmTpl::Init(@aParms)

This will pass the array intact to the base code were the loop may be.

the array loop may be:

if type('aParms') # 'U'
for i = to alen(aParms)
if aParms[i,2] = 'NAME'
this.name = aParms[i,1]
endif
endfor
endif

This is a rough example but you get the idea.

Hope this helps
Tom
Tom
--------------------------------
Tom O'Hare
407-299-4268 -- tom@redtile.com -- http://www.redtile.com/
Independent Programmer Using Visual FoxPro, Visual Basic & more...
Operations Manager -- Virtual FoxPro User Group (VFUG)
http://www.vfug.org/ -- tom@vfug.org
President -- Central Florida FoxPro User Group (CFFUG)
http://www.redtile.com/foxpro/
Universal Thread Most Valued Professional (MVP)
http://www.transformation.com/foxpro/
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform