Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Class/Instance name question

Status
Not open for further replies.

sjpatrick

Programmer
Sep 4, 2001
54
US
Here's the skinny:

I have a contol-type class defined and I am creating instances within my code. Natch, the objects refer to themselves using the *this* keyword.

The trick is that my code is a front-end to a database server and I can only make asynchronous calls to said server. When the reply arrives, *this* no longer has any meaning.

I'vre found a workaround using a public object that stores the calling object's identity for use with the response, but it is most cumbersome. Okay, downright ugly.

I've not been abke to find a function/property/whatever that allows an object to know *who it is,* i.e. :

var obj = new classInstance;

Is there a way for the classInstance class object to determine that its instance name is *obj*?

I'll bet everyone scratches their head about this one, as in *what the heck is he talking about?* ;-)

Thanks for any help.
 
Have a look at:

Also, perhaps you could consider recreating the object with the values stored in the DB (if I understand correctly), so you would have an identical clone rather than the original object.

Posting code? Wrap it with code tags: [ignore]
Code:
[/ignore][code]CodeHere
[ignore][/code][/ignore].
 
Short and sweet. ;-)

I sortof figured that would be the answer.
Thanks for at least confirming that I hadn't overlooked anything.

I'll give that article a look, thanks again.

<geek/>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top