Asp – Best way to create a Map in Classic ASP

asp-classicmaps

I'm currently rewriting some PHP 4 code to Classic ASP (don't ask) and trying to work out if there's a better way to load a large Map into memory than just hard coding each pair in.

To give you an idea, there's around 300 unique key value pairs in the hashed array definition (or whatever it's called) in the PHP.
I'm tempted to just do that again in ASP like:

<%
dim map
set map = CreateObject("Scripting.Dictionary")
map.add('key','value')
map.add('key2','value2')
...
%>

With this map getting loaded into memory for each call, is there any other way of doing this that would be quicker? The only time the map is used is to find out if an argument matches up to one of the keys – if so the value is pulled out and returned.

Thanks for your help.

Best Answer

Well you need to understand the Application and the Session objects in ASP before continuing with the project. I was under the assumption that you have a reason to keep that outside the global cache (like constantly having to update the contents of the object based on the user preference)

All the best

Related Topic