ASP Collection?

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View
On my ASP page I have a two dimentional array, three elements wide by a
variable number long. The first element is the data field of the source
data, the second element is a column name that is displayed to the user, the
last element is the width of the column when displayed to the user.

On this page I'm displaying a list of checkboxes and need to preload some of
these boxes based on the array. Unfortunately, the order of the checks and
the order of the array do not match. Also, many of the checkboxes won't
exist in the array at all.

It would be great if I could check to see if a particular value is held
anyplace in the first element of the array. I could do this with a for/next
loop, but that really isn't very efficient.

I'm pretty sure that I can do this with a dictionary object, but I can't see
how I could create a multi element dictionary object.

  dim d
  set d=Server.CreateObject("Scripting.Dictionary")
  d.add "FirstName","First Name"
  d.add "Surname","Last Name"
  d.add "Sex","Gender"
  response.write d.Exists("Surname")  ' This will be true.

As you can see, I can use the 1st element as the key, since it will be
unique, and the 2nd element will be the value, but how can I also store the

Re: ASP Collection?

Quoted text here. Click to load it


Actually, I've reworked my page to use multiple scripting dictionary objects
for a much better solution.

Re: ASP Collection?

Noozer wrote:

Quoted text here. Click to load it

Even better would be to use JavaScript (or even PerlScript). Having to
swallow the overhead of Scripting.Dictionary objects for such a trivial
task is a bad solution as a choice of tools, no matter how you then
proceed to code it.

Site Timeline