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 parameter such that the url is something like

1
"http://domain.com/path/database.nsf/pathtoMyAgent/MyAgent?OpenAgent123"

, where 123 is the parameter value you are looking for

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
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.

This entry was posted in Code, Lotus Domino, Show-n-Tell+Thursday, Web. Bookmark the permalink. Post a comment or leave a trackback: Trackback URL.

Post a Comment

Your email is never published nor shared. Required fields are marked *

*
*
  • Follow

  • Archives (since 2003)

  • Categories

  • Recent Posts

  • Twitter Updates

  • del.icio.us links

  • Flickr

    Runnymede Healthcare Centre Demolition : The EndRunnymede Healthcare Centre Demolition : The EndRunnymede Healthcare Centre Demolition : The EndRunnymede Healthcare Centre Demolition
  •  

    March 2004
    M T W T F S S
    « Feb   Apr »
    1234567
    891011121314
    15161718192021
    22232425262728
    293031  
  • Spam Blocked