Is this where I can ask a Lotus Script question? I'm new to using Lists, so hopefully this is an easy one.
The below code is a subset what I'm trying to do, but I have narrowed down the error to this line If num < iMin Then (if I comment out the if, then there is no error).
I get the Type Mismatch error when I bring up the view that has button on the view.
I tried to do the min as a function (new to Lotusscript functions too), but wasn't sure if that was part of the problem.
Thanks in advance!
Dim ListOfProgramJoinDates List As NotesDateTime
Dim LowestDate As NotesDateTime
If doc.Co_Program1YearJoined1st_DATE(0) = "" Then
Set ListOfProgramJoinDates("Program1") = New NotesDateTime(Datenumber(2400 , 12 , 31))
Else
Set ListOfProgramJoinDates("Program1") = New NotesDateTime(Datevalue(doc.Co_Program1YearJoined1st_DATE(0) ))
End If
If doc.Co_Program2YearJoined1st_DATE(0) = "" Then
Set ListOfProgramJoinDates("Program2") = New NotesDateTime(Datenumber(2400 , 12 , 31))
Else
Set ListOfProgramJoinDates("Program2") = New NotesDateTime(Datevalue(doc.Co_Program2YearJoined1st_DATE(0) ))
End If
Dim iMin As New NotesDateTime(Datenumber(2400 , 12 , 31))
Forall num In ListOfProgramJoinDates
If num < iMin Then ' TYPE MISMATCH ON THIS LINE
' Set iMin = num
End If
End Forall
Set LowestDate = iMin
I canot comment, let's hope I can modify and add the response ....
You cannot compare two objects using the operator < or >.
Instead you should use a numeric propertiy of both objects like LSLocalTime (if num.LSLocalTime < iMin.LSLocalTime) or use the TimeDifference method of one (if num.TimeDifference(iNum) < 0 then)