?
Solved

Collection objects in VBScript

Posted on 2003-12-12
4
Medium Priority
?
2,505 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 28

Accepted Solution

by:
sybe earned 1000 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

Industry Leaders: 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

I recently decide that I needed a way to make my pages scream on the net.   While searching around how I can accomplish this I stumbled across a great article that stated "minimize the server requests." I got to thinking, hey, I use more than one…
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 tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
Suggested Courses

770 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