Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Storing Object References
Message
De
27/09/1996 12:45:34
Paul Wei
Fib, State of Michigan
Lansing, Michigan, États-Unis
 
 
À
26/09/1996 18:35:29
Paul Watson
Mcv Global Systems, Inc.
Pasadena, Californie, États-Unis
Information générale
Forum:
Visual FoxPro
Catégorie:
Classes - VCX
Divers
Thread ID:
00008632
Message ID:
00008668
Vues:
35
>>>In a VFP form all control object references are held in the Controls() array. I want to build an array that contains references for selected controls on my form. My goal is to be able to clear the ControlSource for selected text box controls and then set them to a saved value later. I can clear them with SetAll(). What I need is an easy way to restore them. I would like to be able to say ThisForm.Controls[nPtr].ControlSource = ThisForm.Controls[nPtr].SavedControl. The problem with that is that my form has multiple pages and it gets messy. I want to create my own array with a hand full of text box controls in it.
>>>
>>>My question is how do I store the object's reference into an array?
>>>
>>>Thanks!
>>
>>
>>Look at createobject(). Use a public array instead on just a memvar. Better yet use an array set as an objects property.
>>
>>Tom
>
>
>I was planning on creating the array as a form property. I guess I was a little unclear in my explanation. The text box objects already exist on the form. I want to store references to them in the array so that I can easily get back to them later. I really want to say "aArray[nPtr] = THIS". I know I can't do that though. Then later I could say aArray[nPtr]. = .

Yes, you can do exactly what you've proposed. Just make sure you add "thisform." to the front of "aArray[nPtr]" if the array is a property of the form.

Paul
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform