![]() ![]() ![]() ![]() ![]() Gravitybox Schedule Primer
Page 90
1998-2004 Gravitybox Software LLC
is no free spot available before the end of the schedule, this method returns a reference
to Nothing.
Figure 8.2
After calling the method with an IgnoreIndexes parameter set to 2, the GetNextSlot
method will return results that may be used to move the specified appointment to the
next free slot.
Dim oCurrent As CScheduleEl
Dim oItem As CScheduleEl
Dim dtNextTime As Date
'Appointment to be moved
Set oCurrent = Schedule1.ScheduleItems(2)
'Get the next time on the schedule after this
'selected appointments StartTime
dtNextTime = DateAdd("n", Schedule1.ScheduleIncrement, _
oCurrent.StartDate)
'Search for next appointment
Set oItem = Schedule1.GetNextFreeSlot( _
dtNextTime, _
0, _
oCurrent.StartTime, oCurrent.Length, _
oCurrent.Index)
'Move the appointment to the next
'free slot if one exists
If Not (oItem Is Nothing) Then
oCurrent.StartDate = oItem.StartDate
oCurrent.StartTime = oItem.StartTime
End If
|