Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
AddObject in a Class
Message
 
 
To
23/07/2001 16:08:26
Jay Johengen
Altamahaw-Ossipee, North Carolina, United States
General information
Forum:
Visual FoxPro
Category:
Classes - VCX
Miscellaneous
Thread ID:
00534066
Message ID:
00534079
Views:
15
There are a few syntactical erros in the post. I'll chalk that up to bad typing. ;-)

Use Eval() to get the object reference before accessing the PEMs.
Local cCurrentScrollBlocker, oRef

cCurrentScrollBlocker = 'shp_' + This.Name
oRef = eval('This.Parent.' + This.Name)
oRef.Visible = .T.
HTH.

>I want to do AddObject in the Init of a class to add a shape for each instance during runtime:
>
>Init Code
>
>
>Local cCurrentScrollBlocker
>
>cCurrentScrollBlocker = 'shp_' + This.Name
>This.Parent.AddObject(cCurrentScrollBlocker,'Shape')
>
>
>A portion of the object is derived from the current name of the class and I'm referencing using macro substitution like:
>
>Refresh Code
>
>
>Local cCurrentScrollBlocker, oRef
>
>cCurrentScrollBlocker = 'shp_' + This.Name
>oRef = 'This.Parent." + This.Name
>&oRef..This.Visible = .T.
>
>
>During runtime, the last line in the Refresh is causing an error. It says basically that the object for oRef does not exist. Any ideas? Thanks!
>
>Regards, Renoir
Larry Miller
MCSD
LWMiller3@verizon.net

Accumulate learning by study, understand what you learn by questioning. -- Mingjiao
Previous
Reply
Map
View

Click here to load this message in the networking platform