Solved

Collection objects in VBScript

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
How to speed up an ASP/MS SQL web application 6 69
Auto Submit on dropdown box 14 49
ASP CDO - Limiting Connections 2 39
Javascript to allow login/password authorization 4 28
I have helped a lot of people on EE with their coding sources and have enjoyed near about every minute of it. Sometimes it can get a little tedious but it is always a challenge and the one thing that I always say is:  The Exchange of information …
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…
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…
Send secure, cloud-based, encrypted alerts and maintain HIPAA compliant messaging. Integrates priority & secure messaging into one application. Ensures IT, emergency respondents and healthcare professionals that their critical messages are never mis…

911 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

20 Experts available now in Live!

Get 1:1 Help Now