Solved

Collection objects in VBScript

Posted on 2003-12-12
4
2,489 Views
Last Modified: 2011-09-20
Hello
I am used to writing web applications using Java, php but not VBScript and ASP.... however I have inherited a legacy system that requires that I use VBScript....
I was wondering whether vbscript has any collection objects that can be resized at runtime, like linked list, vectors or arrayList in java.

thanks
0
Comment
Question by:lz7cjc
  • 2
4 Comments
 
LVL 28

Accepted Solution

by:
sybe earned 250 total points
ID: 9928785
Set MyDictionary = Server.CreateObject("Scripting.Dictionary")


0
 
LVL 35

Expert Comment

by:YZlat
ID: 9929268
VBScript has a collection object.

check this out:
http://www.webgecko.com/products/apgen/docs.asp?page=objcollection.htm
0
 
LVL 35

Expert Comment

by:YZlat
ID: 9929284
0
 
LVL 15

Expert Comment

by:deighc
ID: 9929442
VBScript DOESN'T have a collection object.

It can access collections that come from other objects but you can't create them in VBScript itself.

@YZlat, your first link is documentation for Active Page Generator - they just have examples in VBScript. Your second example shows how to create a collection in Visual Basic and access it in VBScript. And your third example just lists collection properties that come out of other objects (the file system object for example).

There is no way you can create a collection object in VBScript.

@Sybe's example using a Dictionary object is the closest thing you get in VBScript. In practice, it behaves very similarly.

Your only other option for grouping objects together is in an array (but these have to be explicitly re-sized in VBScript - you can't just wantonly increase it's size by adding new items, as you no doubt already know).
0

Featured Post

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

I would like to start this tip/trick by saying Thank You, to all who said that this could not be done, as it forced me to make sure that it could be accomplished. :) To start, I want to make sure everyone understands the importance of utilizing p…
Have you ever needed to get an ASP script to wait for a while? I have, just to let something else happen. Or in my case, to allow other stuff to happen while I was murdering my MySQL database with an update. The Original Issue This was written…
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …

706 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now