Dim startcycle As New NotesDateTime( "01/15/2005" )
Dim workingwithdate As NotesDateTime
Dim paycyclekeys(1 To 24) As Variant
Dim x As Integer
For x = 1 To 24
If x = 1 Then
'just take the first cycle
paycyclekeys(x) = startcycle.LSLocalTime
Else
'set to the previous cycle date
Set workingwithdate = New NotesDateTime( paycyclekeys(x-1) )
'increment to the next cycle from the previous
If Day(workingwithdate.LSLocalTime)=15 Then
'second half cycle (last day)
Call workingwithdate.AdjustMonth( 1 )
Call workingwithdate.AdjustDay( -15 )
paycyclekeys(x) = workingwithdate.LSLocalTime
Else
'next first half cycle (15th)
Call workingwithdate.AdjustDay( 15 )
paycyclekeys(x) = workingwithdate.LSLocalTime
End If
End If
Next x