Aantal dagen in een bepaalde periode met LotusScript

Voor een applicatie moest herhaaldelijk uitgerekend worden hoeveel dagen er in een bepaalde periode zitten.
De volgende functie voldeed hier goed:

Input: getDaysBetween(“31-12-2007″,”01-01-2007”, “1,7” ,”25/12/07 – 26/12/07,05-12-2007″,Doc)  

Output: 258

Function getDaysBetween(strStart As String, strEnd As String,daysToExclude As String , datesToExclude As String ,Doc As NotesDocument) As Long
On Error GoTo ErrorHandler
Dim Formula As Variant
Dim dLow As String
Dim dHigh As String

If strStart = “” Or strEnd = “” Then GoTo ErrorHandler

strStart = {@TextToTime(“} & strStart & {“)}
strEnd= {@TextToTime(“} & strEnd & {“)}

If daysToExclude = “” Then
dLow = {;0}
Else
dLow = {;@TextToNumber(@Explode(“} & daysToExclude & {“;”,”))}
End If

If Not datesToExclude = “” Then
dLow = dLow & {;@TextToTime(@Explode(@TextToTime(@Explode(“} & datesToExclude & {“;”,”))))}
End If

dHigh$ = {@BusinessDays(} & strStart$ & {;} & strEnd$ & dLow & {)}
dLow$ = {-@BusinessDays(} & strEnd$ & {;} & strStart$ & dLow & {)}

Formula = Evaluate({@If(} & strStart & {>} & strEnd & {;} & dLow$ & {;} & dHigh$ & {)} ,Doc)

getDaysBetween = CLng(Formula(0))

Exit Function
ErrorHandler:
MsgBox GetThreadInfo(1) & ” ” & Error & ” (” & Err & “) op regel ” & Erl & “.”
getDaysBetween = 0
Exit Function
Resume Next
End Function

@LocationGetInfo

Om informatie uit het huidige locatie document van de Notes Client op te halen kun je de formule @LocationGetInfo gebruiken.
Als parameter geef je de veldnaam op die je wilt uitlezen.

Enkele voorbeelden:

@LocationGetInfo([FullName]) : Locatienaam
@LocationGetInfo([MailServer]) : Homeserver
@LocationGetInfo([InternetMailAddress]) : e-mail adres
@LocationGetInfo([NamePreference]) : 0 voor standaard naam, 1 voor alternatieve naam
@LocationGetInfo([BookmarksFilename]) : standaard bookmark.nsf
@LocationGetInfo([SametimeServer]) : Sametime Server
enz…