I've tried to figure this issue out on my own, but perhaps there is something I am misunderstanding about the way ArrayUnique
works.
Here is some sample LotusScript code:
'Let's test some dates
dateOne = CDat("12/16/2010")
dateTwo = CDat("12/16/2010")
testSuccess = (dateOne = dateTwo)
'On evaluation, testSuccess = true
'Now let's make an array ...
Dim someArray(1) As Variant
someArray(0) = dateOne
someArray(1) = dateTwo
uniqueArray = ArrayUnique(someArray)
'uniqueArray has the same two elements ... the duplicate hasn't been removed
In the above example, dateOne, dateTwo, testSuccess, and uniqueArray are all implicitly-declared variant variables.
What am I doing wrong? I've read in the help where it says:
Usage
Elements in a variant array will only compare equal if they are of the same type. The variant array can't contain classes or objects.
Array elements that contain the null value will match other null values.
Array elements that are empty will match with other elements that are empty.
Well, the variant array in this example contains variant variables that are of a date/time type. So, if I'm reading this correctly, I'm not doing anything wrong.
Edit: On the Notes Forums, user Thoams Kennedy tried the following:
If you spell out the time component like this
dateOne = CDat("12/16/2010 04:20:17 AM")
dateTwo = CDat("12/16/2010 04:20:17 AM")
it will still treat them as distinct. There does not seem to be a millisecond component, so I would say that ArrayUnique does not know how to deal with DateTime variants.
So his conclusion is that ArrayUnique umm, doesn't work.