Skip to main content link. Accesskey S
  • HCL Logo
  • HCL Notes and Domino wiki
  • THIS WIKI IS READ-ONLY. Individual names altered for privacy purposes.
  • HCL Forums and Blogs
  • Home
  • Product Documentation
  • Community Articles
  • Learning Center
  • API Documentation
Search
Community Articles > Lotus Domino > Domino troubleshooting > Type Mismatch when using a list - newbie question (I hope)
  • Share Show Menu▼
  • Subscribe Show Menu▼

Recent articles by this author

Type Mismatch when using a list - newbie question (I hope)

Need help with a Lotusscript programming question
Community articleType Mismatch when using a list - newbie question (I hope)
Added by ~Kim Loplukony | Edited by ~Ned Opfanalit on May 18, 2013 | Version 2
  • Actions Show Menu▼
expanded Abstract
collapsed Abstract
Need help with a Lotusscript programming question
Tags: list, Type Mismatch

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)

 


  • Actions Show Menu▼


expanded Attachments (0)
collapsed Attachments (0)
Edit the article to add or modify attachments.
expanded Versions (1)
collapsed Versions (1)
Version Comparison     
VersionDateChanged by              Summary of changes
This version (2)May 18, 2013, 9:21:14 AM~Ned Opfanalit  
expanded Comments (0)
collapsed Comments (0)
Copy and paste this wiki markup to link to this article from another article in this wiki.
Go ElsewhereStay ConnectedAbout
  • HCL Software
  • HCL Digital Solutions community
  • HCL Software support
  • BlogsDigital Solutions blog
  • Community LinkHCL Software forums and blogs
  • About HCL Software
  • Privacy
  • Accessibility