Photo Gallery Member List Search Calendars FAQ Ticket List Log Out


vbscript class inheritance

 
Logged in as: Guest
arrSession:exec spGetSession 2,2,65248
 Active Users: There are 0 members and 0 guests.
 Users viewing this topic: none
 

 

 
  
  Printable Version
All Forums >> [Scripting] >> WSH & Client Side VBScript >> vbscript class inheritance
  Do you like VisualBasicScript.com? Link to us and help spread the word about our forum. Thanks!
Page: [1]
Login
Message << Older Topic   Newer Topic >>
 vbscript class inheritance - 10/19/2008 12:40:53 AM   
  atwork8

 

Posts: 7
Score: 0
Joined: 5/2/2008
Status: offline
Hi all,

I've been working on this class inheritance technique to help me maintain some legacy apps:

http://www.aspmessageboard.com/showthread.php?t=229924

I'm pretty happy with it so far however there is one thing I don't like about it. When working on the object itself you have to pass a reference to the object to any functions/methods, this is so the method knows what object to work on as it can be inherited. So my question is, can vbscript return some kind of reference to its caller e.g.

function one()
    response.write "i was called by " & caller
end function

I'm pretty sure this isn't possible but I thought I'd ask in case it is, which would be good! I know I can get around this problem by using a native class and a dictionary object to represent each class but this seemed like extra overhead when things could be a lot easier if I could get the caller reference.

OR even better still... if getRef could reference functions within a class structure, now that would be good ;)

Any help would be appreciated, thanks :)
 
 
Post #: 1
 
 RE: vbscript class inheritance - 10/20/2008 1:23:28 AM   
  ebgreen


Posts: 5251
Score: 31
Joined: 7/12/2005
Status: offline
VBScript does not provide this level of introspection.

_____________________________

"... when you are good and crazy, oooh, oooh, oooh, the sky is the limit!" - The Tick
Goog places to start:http://www.visualbasicscript.com/m_24727/tm.htm
http://www.visualbasicscript.com/m_47117/tm.htm

(in reply to atwork8)
 
 
Post #: 2
 
 RE: vbscript class inheritance - 10/20/2008 2:55:26 AM   
  TNO


Posts: 1402
Score: 16
Joined: 12/18/2004
From: thenewobjective.com
Status: offline
use JavaScript since its asp compatible and provides stack inspection and reflection (of course instead of class inheritance it uses prototype inheritance which may blow your mind if you aren't use to thinking that way)

_____________________________

To iterate is human, to recurse divine. -- L. Peter Deutsch

(in reply to ebgreen)
 
 
Post #: 3
 
 
 
  

If you found our site useful please link to us <a href="http://www.visualbasicscript.com">VisualBasicScript.com</a>.
All Forums >> [Scripting] >> WSH & Client Side VBScript >> vbscript class inheritance Page: [1]
Jump to:





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts