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.netAccumulate learning by study, understand what you learn by questioning. -- Mingjiao