This Blog has moved to

False Positives Adventures in Technology, SciFi and Culture from Toronto

Wednesday, March 31, 2004

Very simple LotusScript function to parse value on url line

Below Is a very simple LotusScript code function that assumes that there is only one paramenter such that the url is something like "pathtoMyAgent/MyAgent?OpenAgent&123", where 123 is the parameter value you are look for

Function ExtractPassedParameter As String
' This routine parses parameters sent to the agent in the
' command line. to the right of the &

Dim paramdoc As NotesDocument
Dim pathinfo, param As String
Dim eq As Integer

Set paramdoc = ses.documentcontext

pathinfo = paramdoc.PATH_INFO(0)

eq = Instr(pathinfo,"&")
If eq = 0 Then
ExtractPassedParameter = ""
Exit Function
End If

' discard every before the first &
param = Right(pathinfo,Len(pathinfo)-eq)

ExtractPassedParameter = Ucase$(param)

End Function

This is old code, I've used for a looong time (maybe back in the EVI days?) . I don't know If I wrote it or stole it from someone smarter than me.

Please Note that this Blog (False Positives) has moved to

Links to this post:

Create a Link

<< Home