Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Does vbScript have non-integer array keys like PHP? 1

Status
Not open for further replies.

Spork52

Programmer
Nov 20, 2007
134
US
Does vbScript have non-integer array keys like PHP? After looking around the web I suspect the answer is no, but thought I'd ask.
 
Thanks. The link was for the wrong scripting language, but I found plenty of dictionary stuff for ASP. Sure helps to know what you're looking for. Here's the basic idea:

Code:
<%@ LANGUAGE="VBSCRIPT" %>
<%
Dim objDict
'Create an instance of the Dictionary object
Set objDict = Server.CreateObject("Scripting.Dictionary") 

'Add some key/item pairs to a Dictionary
objDict.Add "key1","item1" 'Add value item1 with key key1
objDict.Add "key2","item2" 'Add value item2 with key key2
objDict.Add "key3","item3" 'Add value item3 with key key3

'retrieve the item value for the "key1" and print it out 
myItem = objDict.Item("key1")
Response.Write("The value corresponding to the key1 is " & myItem & "<br />") 
%>

Unfortunately kind of clumsy and array functions can't be applied easily.

Above code is from where there are many more details.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top