Welcome to the North American Subaru Impreza Owners Club Friday March 29, 2024
Home Forums Images WikiNASIOC Products Store Modifications Upgrade Garage
NASIOC
Go Back   NASIOC > NASIOC Miscellaneous > Off-Topic

Welcome to NASIOC - The world's largest online community for Subaru enthusiasts!
Welcome to the NASIOC.com Subaru forum.

You are currently viewing our forum as a guest, which gives you limited access to view most discussions and access our other features. By joining our community, free of charge, you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is free, fast and simple, so please join our community today!

If you have any problems with the registration process or your account login, please contact us.







* As an Amazon Associate I earn from qualifying purchases. 
* Registered users of the site do not see these ads. 
Reply
 
Thread Tools Display Modes
Old 10-17-2003, 01:35 PM   #1
Idjiit
Scooby Specialist
 
Member#: 5310
Join Date: Mar 2001
Chapter/Region: South East
Location: Raleigh, NC
Vehicle:
2013 Sonic Turbo

Default 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.
Idjiit is offline   Reply With Quote
Sponsored Links
* Registered users of the site do not see these ads.
Old 10-17-2003, 02:47 PM   #2
mofobaru
Scooby Newbie
 
Member#: 37416
Join Date: May 2003
Location: Orange County, CA
Vehicle:
2004 WRX Wagon
Silver

Lightbulb

For Each i In obj
// do this
Next
mofobaru is offline   Reply With Quote
Old 10-17-2003, 02:48 PM   #3
Idjiit
Scooby Specialist
 
Member#: 5310
Join Date: Mar 2001
Chapter/Region: South East
Location: Raleigh, NC
Vehicle:
2013 Sonic Turbo

Default

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...
Idjiit is offline   Reply With Quote
Old 10-17-2003, 02:51 PM   #4
beethoven
Scooby Newbie
 
Member#: 6654
Join Date: May 2001
Chapter/Region: MWSOC
Location: Wis-Con-sin
Vehicle:
2006 Odyssey

Default

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.
beethoven is offline   Reply With Quote
Old 10-17-2003, 02:57 PM   #5
Idjiit
Scooby Specialist
 
Member#: 5310
Join Date: Mar 2001
Chapter/Region: South East
Location: Raleigh, NC
Vehicle:
2013 Sonic Turbo

Default

Yeah, I hate VB. Unfortunately, it looks like the guys who wrote the control did it correctly and made all the props/methods private.
Idjiit is offline   Reply With Quote
Old 10-17-2003, 02:59 PM   #6
Foovanadil
Scooby Newbie
 
Member#: 23515
Join Date: Aug 2002
Chapter/Region: SCIC
Location: San Diego, CA
Vehicle:
2011 Legacy GT
Steel Silver Metallic

Default

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?
Foovanadil is offline   Reply With Quote
Old 10-17-2003, 03:00 PM   #7
Idjiit
Scooby Specialist
 
Member#: 5310
Join Date: Mar 2001
Chapter/Region: South East
Location: Raleigh, NC
Vehicle:
2013 Sonic Turbo

Default

I wasn't getting the results I expected/wanted, so I decided to poke around using VBScript instead.
Idjiit is offline   Reply With Quote
Old 10-17-2003, 03:01 PM   #8
Foovanadil
Scooby Newbie
 
Member#: 23515
Join Date: Aug 2002
Chapter/Region: SCIC
Location: San Diego, CA
Vehicle:
2011 Legacy GT
Steel Silver Metallic

Default

hmmm I gotcha.

what were you trying to do in the first place that wasn't working in JS?


Brad
-Programming Ninja
Foovanadil is offline   Reply With Quote
Old 10-17-2003, 03:02 PM   #9
Idjiit
Scooby Specialist
 
Member#: 5310
Join Date: Mar 2001
Chapter/Region: South East
Location: Raleigh, NC
Vehicle:
2013 Sonic Turbo

Default

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?
Idjiit is offline   Reply With Quote
Old 10-17-2003, 03:36 PM   #10
Foovanadil
Scooby Newbie
 
Member#: 23515
Join Date: Aug 2002
Chapter/Region: SCIC
Location: San Diego, CA
Vehicle:
2011 Legacy GT
Steel Silver Metallic

Default

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?
Foovanadil is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

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

All times are GMT -4. The time now is 09:40 AM.


Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Powered by Searchlight © 2024 Axivo Inc.
Copyright ©1999 - 2019, North American Subaru Impreza Owners Club, Inc.

As an Amazon Associate I earn from qualifying purchases.

When you click on links to various merchants on this site and make a purchase, this can result in this site earning a commission
Affiliate programs and affiliations include, but are not limited to, the eBay Partner Network.