Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Name of variable associated with an object
Message
From
30/11/2000 16:05:17
 
General information
Forum:
Visual FoxPro
Category:
Windows API functions
Miscellaneous
Thread ID:
00447637
Message ID:
00447680
Views:
17
>Hi All,
>Does anyone have a utility that will give me the name of a variable associated with an object?
>
>Here is what I know (the little there is):
>When an object is assigned to a variable, the internal reference counter of that object is incremented. When that variable is released (in some fashion), the reference counter is decremented.
>
>Looking at the VFP API functions, it looks like given a variable name, I can get it position in the internal Memory Index.

Really? How? You mean with the LCK?

>The reason for this is because of an error handler I am creating. The syntax still exists to RETURN TO < ProcedureName >. If an error occurs I want to totally exit the object and return to whatever called it. What I am doing is at the beginning of a method call, I store the name of the procedure that called it using Program(Program(-1)-1). If an object called it, it is stored in the form of ClassName.MethodName. An error occurs in the RETURN TO line because it doesn't want that format. It wants VariableName.MethodName.
>
>I appreciate any feedback but I will say now I already have a workaround. During object instantiation, I pass in the name of the variable that it is being assigned to and use it in my return statement. I was hoping to avoid this and by making the object smarter.

SYS(1272)?
Erik Moore
Clientelligence
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform