|
|
|
|
Thread Tools | Display Modes |
10-17-2003, 01:35 PM | #1 |
Scooby Specialist
Member#: 5310
Join Date: Mar 2001
Chapter/Region:
South East
Location: Raleigh, NC
Vehicle:2013 Sonic Turbo |
VBScript question...
Anyone know how to loop through an object and grab all its methods/properties?
Equivalent code in JS is like: for( var i in obj ){ // do this }
* Registered users of the site do not see these ads.
|
10-17-2003, 02:47 PM | #2 |
Scooby Newbie
Member#: 37416
Join Date: May 2003
Location: Orange County, CA
Vehicle:2004 WRX Wagon Silver |
For Each i In obj
// do this Next |
10-17-2003, 02:48 PM | #3 |
Scooby Specialist
Member#: 5310
Join Date: Mar 2001
Chapter/Region:
South East
Location: Raleigh, NC
Vehicle:2013 Sonic Turbo |
Doesn't work on classes - only arrays/collections.
But for my purposes, I think I'll just peek into it using JS, which should work... |
10-17-2003, 02:51 PM | #4 |
Scooby Newbie
Member#: 6654
Join Date: May 2001
Chapter/Region:
MWSOC
Location: Wis-Con-sin
Vehicle:2006 Odyssey |
VBScript isn't truly object oriented so you're probably SOL. Yes it supports classes, but it's mainly their to give people a confortable way to call procedures.
|
10-17-2003, 02:57 PM | #5 |
Scooby Specialist
Member#: 5310
Join Date: Mar 2001
Chapter/Region:
South East
Location: Raleigh, NC
Vehicle:2013 Sonic Turbo |
Yeah, I hate VB. Unfortunately, it looks like the guys who wrote the control did it correctly and made all the props/methods private.
|
10-17-2003, 02:59 PM | #6 |
Scooby Newbie
Member#: 23515
Join Date: Aug 2002
Chapter/Region:
SCIC
Location: San Diego, CA
Vehicle:2011 Legacy GT Steel Silver Metallic |
VBScript does not support reflection (which is what you are talking about in JavaScript)
The only way to allow VB objects to "reflect" thier contents is to build the functionality into them yourself. Which would probalby be a waste of time in your case. Like you said just use JavaScript. Why are you using VBScript anyways? |
10-17-2003, 03:00 PM | #7 |
Scooby Specialist
Member#: 5310
Join Date: Mar 2001
Chapter/Region:
South East
Location: Raleigh, NC
Vehicle:2013 Sonic Turbo |
I wasn't getting the results I expected/wanted, so I decided to poke around using VBScript instead.
|
10-17-2003, 03:01 PM | #8 |
Scooby Newbie
Member#: 23515
Join Date: Aug 2002
Chapter/Region:
SCIC
Location: San Diego, CA
Vehicle:2011 Legacy GT Steel Silver Metallic |
hmmm I gotcha.
what were you trying to do in the first place that wasn't working in JS? Brad -Programming Ninja |
10-17-2003, 03:02 PM | #9 |
Scooby Specialist
Member#: 5310
Join Date: Mar 2001
Chapter/Region:
South East
Location: Raleigh, NC
Vehicle:2013 Sonic Turbo |
Exactly what we're talking about. When I try to drill into it, nothing is there even though I know some of the method names that I can call successfully. Does that mean that all the props/methods are set as Private instead of Public? I thought Private would mean you couldn't even call the methods externally?
|
10-17-2003, 03:36 PM | #10 |
Scooby Newbie
Member#: 23515
Join Date: Aug 2002
Chapter/Region:
SCIC
Location: San Diego, CA
Vehicle:2011 Legacy GT Steel Silver Metallic |
hmm
Well Basically Private Means they are only available to that object Protected means the would be available to the object and it's decendants Public is available to everyone could you expand a little more on what you did to "drill down" into the object? |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
VBScript stupid question | -=C=- | Off-Topic | 10 | 09-23-2009 12:17 PM |
dumb question, how do I exit a vbscript properly? | -=C=- | Off-Topic | 0 | 02-25-2008 03:21 PM |
VBScript gurus.. help! | Diversion | Off-Topic | 2 | 06-05-2007 07:05 PM |
vbscript to pull server cert expiration date | blaster88 | Off-Topic | 1 | 06-15-2005 12:06 AM |
Questions questions questions... | mykrrrr | Mid West Subaru Owners Club Forum -- MWSOC | 16 | 04-08-2002 10:08 PM |