Solved

Collection objects in VBScript

Posted on 2003-12-12
4
2,500 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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Weighted Randomizing 6 33
Code Manager | Snippits 2 65
Button on Table, name table1 not working 4 34
Table header must be on top 2 30
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 demonstration started out as a follow up to some recently posted questions on the subject of logging in: http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/Q_28634665.html and http://www.experts-exchange.com/Programming/…
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial

733 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