I should create a category called "saved my ass"! This script would fall under it.
I was asked to create a "look up" tool that would sort of "translate" one piece of text to another. The user would enter in the first piece of text, and then they'd be given the "value". Oh, and this list updates every few months or so.
At first I started looking into creating a database, and writing a script that would update that database – problem was that creating and accessing a database for this project was going to be time consuming and difficult. A server-side script would have been the best solution under the circumstances. A few hours this morning searching around turned up this "dictionary" script.
I'm actually being given the the text and values in excel, so I just need to create a sort of "template" in excel that formats everything so it will look like the code – and then I just copy and paste it all into the ASP file.
So here's kind of what I have in my file:
SET TextToNumber=CreateObject("Scripting.Dictionary")
TextToNumber.Add "name", "292949"
TextToNumber.Add "date", "123414"
etc. etc…
Then my form looks like this: