Forum Moderators: open
However, the data type of Request.Querystring is a string, which means many array functions can't be used.
Is there an easy way for me to make Request.Querystring a "real" array, or is there some other flaw in my approach?
Dim getArray
set getArray = Server.CreateObject("Scripting.Dictionary")For each Key in Request.QueryString
getArray.Add Key, Request.QueryString(Key)
Next
Is this a reasonable method?
Reference
Request.QueryString Collection [msdn.microsoft.com]
The two reasons for this are that the dictionary object allows me to remove individual items, and because I want to manipulate the data. I'd rather keep Request.QueryString as the raw data from the query string.
The code I'm using is to loop through the items, but removing one at the end of each loop, e.g. in an array of three items:
1,2,3
1,2
1
My troubles started when I could not find an easy way to remove items from an array in classic ASP. I'm afraid I'm used to PHP where there's a function to knock the last item off an array. Most probably, there is an entirely different approach I should be using.