Using the "Scripting.dictionary" object

Hi!

Does the "Scripting.dictionary"-object work differently under Sun ASP than it does in a Microsoft environment?

The code below works fine with MS IIS6 but I can't get it to work in a "chiliasp" environment... is it something wrong with the code or does the "Scripting.dictionary"-object behave diffently?

Thanks in advance

Patrik Karlsson

<%

Class cBook

Dim sAuthor

Dim sTitle

Public Property Get Author

Author = sAuthor

End property

Public Property Let Author(value)

sAuthor = value

End Property

Public Property Get Title

Title = sTitle

End property

Public Property Let Title(value)

sTitle = value

End Property

End Class

Class cLibrary

Dim oBooks

Sub Class_initialize()

Dim tmp

set oBooks = Server.CreateObject("Scripting.dictionary")

set tmp = new cBook

tmp.Author = "Dan Brown"

tmp.Title = "The Da Vinci Code"

oBooks.add 1,tmp

set tmp = nothing

set tmp = new cBook

tmp.Author = "Stephen King"

tmp.Title = "Kingdom Hospital"

oBooks.add 2,tmp

End sub

Public Property Get Books

set Books = oBooks

End property

End Class

Dim item

Dim myLibrary

set myLibrary = new cLibrary

For each item in myLibrary.books.items

response.write "Author: " & item.Author & "<br/>"

response.write "Title: " & item.Title & "<br/><br/>"

next

%>

[1560 byte] By [p-k] at [2007-11-26 8:41:05]
# 1
Seems like a bug in vbscript library on unix platforms. Your code should work fine if you run Sun ASP 4.x on Windows. You might want to code around this functionality if you need to run this stuff on unix.
Sultal at 2007-7-6 22:18:36 > top of Java-index,Web & Directory Servers,Web Servers...
# 2
Thanks Sultal for your quick answer! Made a solution using an array instead.Best RegardsPatrik
pk at 2007-7-6 22:18:36 > top of Java-index,Web & Directory Servers,Web Servers...
# 3
I also faced problem with scripting.dictionary object on sun one asp. in my case the keys were getting sorted automatically which was not desired. Ultimately i hd to find a work around with arrays.
Saugata_roy at 2007-7-6 22:18:36 > top of Java-index,Web & Directory Servers,Web Servers...