About This Code
Brief Description:
Class QueryString
Contributor:
Andrew Jones
Last Modified:
17 Jun 2002
OpenNTF Disclaimer
All of the program code and information presented in the OpenNTF.org Code Bin are provided "as-is", and should be used at your own risk. OpenNTF.org make no express or implied warranty about anything in the Code Bin, and OpenNTF.org will not be responsible or liable for any damage caused by the use or misuse of anything from this site. OpenNTF.org makes no guarantees about anything. Please thoroughly test all of the knowledge and code you find here before you attempt to use them in your production environment.
Code / Description
Code
Class QueryString
Private sQS As String
Sub New(sQueryString As String)
Dim iCount As Integer
iCount = 1
While iCount <= Len(sQueryString)
If Mid$(sQueryString, iCount, 3) = "%20" Then
sQS = sQS + " "
iCount = iCount + 3
Elseif Mid$(sQueryString, iCount, 4) = "%34" Then
sQS = sQS + Chr$(34)
iCount = iCount + 3
Elseif Mid$(sQueryString, iCount, 4) = "%39" Then
sQS = sQS + Chr$(39)
iCount = iCount + 3
Else
sQS = sQS + Mid$(sQueryString, iCount, 1)
iCount = iCount + 1
End If
Wend
End Sub
Function GetParameter(sParam As String) As String
Dim sTmp As String
Dim iPos As Integer
Dim iCount As Integer
sTmp = ""
sParam = Lcase$(Trim$(sParam))
iPos = Instr(1, Lcase$(sQS), sParam)
If iPos > 0 Then
iCount = iPos + Len(sParam) + 1
While (iCount <= Len(sQS)) And (Mid$(sQS, iCount, 1) <> "&")
sTmp = sTmp + Mid$(sQS, iCount, 1)
iCount = iCount + 1
Wend
End If
sTmp = Trim$(sTmp)
GetParameter = sTmp
End Function
End Class
****
now in ur code do
Dim oQS As QueryString
Dim oSessionDoc As NotesDocument
Dim sFilterMaterial as string
Set oSessionDoc = Session.DocumentContext
Set oQS = New QueryString(oSessionDoc.QUERY_STRING(0))
sFilterMaterial = Ucase$(oQS.GetParameter("FilterMaterial"))
Usage / Example