Set thisDoc=s.DocumentContext querystringdecoded = thisDoc.Query_String_Decoded(0) ' get paramter arg(s) desired userkey = GetURLArg(querystringdecoded, "stat") Function GetURLArg(querystringdecoded As String, myparam As String) As String ' this function receives a query_string input and returns just the parameter value desired ' instring - querystring of url ' myparam - the parameter in desired by developer Dim paramstring As String ' the parameters converted to string imploded list Dim paramList As Variant ' this list of parameters and values Dim agentargs List As String ' this list (string based) of args and their values Dim paramkey As String ' the key of the list Dim paramvalue As String ' the value of the key of the list On Error Goto ErrorHandler ' the the querystring paramstring = Strright(querystringdecoded, "OpenAgent&", 1) ' test for parameter(s) If paramstring="" Then ' return nothing GetURLArg="" Exit Function End If ' create the list paramList = Evaluate ({@Explode("} & paramstring & {"; "&")}) ' parse the string above into a List string array Forall arg In paramList paramkey = Strleft(arg, "=") paramvalue = Strright(arg, "=") agentargs(paramkey) = paramvalue End Forall ' return to the developer the parameter the developer is requesting GetURLArg=agentargs(myparam) Exit Function ErrorHandler: If Err=120 Then ' list item did not exist, return nothing GetURLArg="" Exit Function Else ' unexpected error return error msg to screen Print "

Application Error

" Print "
" + "Agent: Error " + Str(Err) + ": " + Error$ End If End Function