|
-
Apr 29th, 2002, 03:28 PM
#1
Thread Starter
Frenzied Member
VBScript Data Structures
I'm not sure that this is what I want to use, but I was playing with the idea of having a hash with one element being an anonymous array. VBScript doesn't have a push, so I have to work around that. Now I have something that borders on obfuscation.
Code:
<% @Language="VBScript" %>
<%
Option Explicit
Dim myDictionary
Set myDictionary = Server.CreateObject("Scripting.Dictionary")
Dim currItem
myDictionary.Add "myArray", Array(5)
myDictionary.Item("myArray") = Split(Join(myDictionary.Item("myArray"), ",") & "," & 10, ",")
myDictionary.Item("myArray") = Split(Join(myDictionary.Item("myArray"), ",") & "," & 15, ",")
%>
<html>
<head>
<title>Test Page</title>
</head>
<body>
<%For currItem = 0 To UBound(myDictionary.Item("myArray"), 1)%>
<p><%=myDictionary.Item("myArray")(currItem)%></p>
<%Next%>
</body>
</html>
Like I said, I'm not completely sold on the anon array as part of the hash, but it is the best set up so far. Question is, is there an easier way to handle it?
Travis, Kung Foo Journeyman
As always, RTFM.
WWW Standards: HTML 4.01, CSS Level 2, ECMA 262 Bindings to DOM Level 1, JavaScript 1.3 Guide and Reference
Perl: Learn Perl, Llama, Camel, Cookbook, Perl Monks, Perl Mongers, O'Reilly's Perl.com, ActiveState, CPAN, TPJ, and use Perl;
YBMS, but Mozilla doesn't.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|