To access dynamically created objects - VBScript

Anything VBScript-related, including Windows Script Host, WMI, ADSI, and more.
Forum rules
Do not post any licensing information in this forum.

Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
Locked
User avatar
krishkri
Posts: 9
Joined: Thu Dec 10, 2009 5:02 pm

To access dynamically created objects - VBScript

Post by krishkri »

Hai,

I am creating N number of dictionary objects (within a for loop) dynamically in main program using VBScript. Is there any method to access theses objects randomly?

jvierra
Posts: 14481
Joined: Tue May 22, 2007 9:57 am
Contact:

To access dynamically created objects - VBScript

Post by jvierra »

You could use the vbscript random function Rnd.
http://msdn.microsoft.com/en-us/library ... S.85).aspx


jvierra
Posts: 14481
Joined: Tue May 22, 2007 9:57 am
Contact:

To access dynamically created objects - VBScript

Post by jvierra »

I have no idea what you are talking about. A dictionary is a single object. You add things to it using the 'Add' method.

If you post your code we might be able to better understand what it is that you are asking.

jvierra
Posts: 14481
Joined: Tue May 22, 2007 9:57 am
Contact:

To access dynamically created objects - VBScript

Post by jvierra »

Most of this code make no sense.

GetObject only works with LDAP strings. It will not get you a dictionary object. Dictionary objects can only be created with "CreateObject".

The code does not appear to d anything useful.

Where did you get this script?
What is it that you are trying to accomplish?

Locked