Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Acessing Controls by Reference or Name
Message
 
To
04/01/2001 10:32:19
General information
Forum:
Visual FoxPro
Category:
Object Oriented Programming
Miscellaneous
Thread ID:
00459325
Message ID:
00459364
Views:
22
>THANKS FOR YOUR QUICK ANSWER!
>
>When I say EVAL I say to my porpertie ObjRef ( an array with the obj reference load at the init of the objects ) like this:
>
>Problems begin when I use:
>
>* - Remeber that ObjRef it's an array and there is no EVAL in this process ---
>#define _grdDtOf THISFORM.ObjRef("grdDtOf")
>lcDummy = _grdDtOf.RECORDSOURCE
>
>To resolve problems I must use
>(1st solution)
>
>LOCAL logrdDtOf
>logrdDtOf = THISFORM.ObjRef("grdDtOf")
>
>lcDummy = logrdDtOf.RECORDSOURCE
>
>---
>(2nd solution)
>
>than I was thinking if this was not to much heavy and wating for an answer of the Universal Thread I put this:
>
>* - Using all "PATH"
>#define _grdDtOf THISFORM.cntRegisto.grdDtOf
>
>lcDummy = _grdDtOf.RECORDSOURCE
>
>---
>(3nd solution)
>
>and I'm thinking put the defines in includes. Is this wath tou mean with #define macros?
>
>The cost of menagement decrease with this solution, but if I use the Obj.Reference this will have no costs. Remember that I can put the ObjRef_Acess methode returning not the reference but the "PATH" and than use the macro operator like this:
>
>LOCAL logrdDtOf
>logrdDtOf = THISFORM.ObjRef("grdDtOf")
>
>lcDummy = &logrdDtOf..RECORDSOURCE
>
>---
>
>I think I have explain the where I was "walking" better now. Do you still thinking that the best way it's the 2nd solution ( if it's this qhat you mean ) ?
>
>THANKS

Manuel,

I'm getting confused, and I'm sorry that I don't really have the time to follow this up further. Yes, I mean put your #DEFINEs in an include file, which you can associate with the the form or class. I fail to see why you need to play this complicated game with the addition of an array of object refs to every control. As you have noted, such references create complications with destruction of the form. If you do need to process all of the controls, there are internally maintained collections and global operations (like the SetAll method), but I'm not sure you really need to use these in your situation. Just adjust the way you make references to these member objects to use the macro-based naming. Good luck.

Mike
Montage

"Free at last..."
Previous
Reply
Map
View

Click here to load this message in the networking platform