Separating QueryString Parameters
After seeing a tip on SearchDomino about parsing QueryStrings in agents, I came up with my own subroutine that puts the decoded QueryString into a List Array of Strings. First, dimension a variable as a List of Strings and then pass it and the QueryString to the PutQSIntoList subroutine. The sub is as follows:

Sub PutQSIntoList(parameters List As String, querystring As String)
  Dim pos As Integer
  Dim listname As String
  Dim listvalue As String
  
  pos = Instr(querystring,"&")
  
  While pos > 0
    listname = Strleft(querystring,"=")
    listvalue = Strleft(Strright(querystring,"="),"&")
    
    parameters(listname) = listvalue
    
    querystring = Strright(querystring,"&")
    
    pos = Instr(querystring,"&")
  Wend
  
  listname = Strleft(querystring,"=")
  listvalue = Strright(querystring,"=")
  
  parameters(listname) = listvalue
End Sub

Simply pass session.DocumentContext.Query_String_Decoded(0) as the second variable and you will get a list of parameters that are easily accessible and ready for use in the rest of your script.

<< Previous Document / Next Document >>
    Be the first in the world to comment on this entry!!!
Post A Comment
Subject: (required)
Name: (required)
Email: (required)
Web Site:
Comment:(No HTML - Links will be converted if prefixed http://)

Remember Me?