>LPARAMETERS toScheduleObject >LOCAL lnBarColor, liStartTime, liEndTime , liStartDate, liEndDate, lnI, lnBarNdx, liItmNdx >*** Clear the time bars just in case the user selected a new start date >*** Or Checks one of the boxes that says "View this event only" etc. >*** The documentation says that the following should work, but in practice >*** it does not - the call to ClearTimeBars() returns true, but they remain >*** visible in the scheduler, so get out the sledge hammer >*!* FOR lnI = 1 TO toScheduleObject.ListCount >*!* toScheduleObject.ClearTimeBars(lnI) >*!* ENDFOR >toScheduleObject.ClearSchedule() >Thisform.Initializelistbar(toScheduleObject) >DO CASE > CASE toScheduleObject = Thisform.pgfSchedule.pgEvents.oSchedule.object > *** Get all the items in the list bar into a cursor in the same order that they are in the list bar > IF Thisform.chkThisEvent.value > SELECT DISTINCT FullName FROM SchedulerService_V WHERE SrvEvtID = Thisform.CurrentEventID INTO CURSOR qTmp NOFILTER > ELSE > SELECT DISTINCT FullName FROM SchedulerService_V ORDER BY FullName INTO CURSOR qTmp NOFILTER > ENDIF > SCAN > liItmNdx = INT(RECNO('qTmp')) > *** Process all the events for that person > SELECT * FROM SchedulerService_V WHERE FullName == qTmp.Fullname INTO CURSOR Fred NOFILTER > SCAN > *** Need to add the case for "Non-Service" once I figure out what the heck that means > DO CASE > CASE Fred.SrvEvtID = Thisform.CurrentEventID > lnBarColor = Thisform.shpThisEvent.BackColor > CASE Fred.ServiceID = Thisform.CurrentServiceid > lnBarColor = Thisform.ShpThisService.BackColor > OTHERWISE > lnBarColor = Thisform.shpOtherService.BackColor > ENDCASE > *** Make sure we actually have a scheduled event > IF NOT EMPTY(Fred.EvtTimeBeg) AND NOT EMPTY(SchedulerService_V.EvtTimeEnd) AND ; > NOT EMPTY(NVL(SchedulerService_V.EvtDateBeg, {})) AND NOT EMPTY(NVL(Fred.EvtDateEnd, {})) > *** Make the the event falls within the selected date range > liStartTime = (VAL(GETWORDNUM(Fred.EvtTimeBeg, 1, ':')) * 60) + VAL(GETWORDNUM(Fred.EvtTimeBeg, 2, ':')) > liEndTime = (VAL(GETWORDNUM(Fred.EvtTimeEnd, 1, ':')) * 60) + VAL(GETWORDNUM(Fred.EvtTimeEnd, 2, ':')) > liStartDate = Fred.EvtDateBeg - {^1900-01-01} > liEndDate = Fred.EvtDateEnd - {^1900-01-01} > *** Make sure that at least part of the event occurs within the specified date range > IF liStartDate <= toScheduleObject.DateEnd AND liEndDate >= toScheduleObject.DateStart > IF NOT Thisform.chkThisEvent.Value > lnBarNdx = toScheduleObject.AddColorBar(liStartTime, liEndTime, liStartDate, liEndDate, lnBarColor, liItmNdx) > toScheduleObject.BarCargo[liItmNdx, lnBarNdx] = PADL(Fred.SrvEvtID, 10, ' ') > toScheduleObject.BarText[liItmNdx, lnBarNdx] = ALLTRIM(Fred.EvtTypeDesc) > ELSE > IF Fred.SrvEvtID = Thisform.CurrentEventID > lnBarNdx = toScheduleObject.AddColorBar(liStartTime, liEndTime, liStartDate, liEndDate, lnBarColor, liItmNdx) > toScheduleObject.BarCargo[liItmNdx, lnBarNdx] = PADL(Fred.SrvEvtID, 10, ' ') > toScheduleObject.BarText[liItmNdx, lnBarNdx] = ALLTRIM(Fred.EvtTypeDesc) > ENDIF > ENDIF > ENDIF > ENDIF > ENDSCAN > SELECT qTmp > ENDSCAN >ENDCASE >I took a quick look and seems Ok to me. I guess you were debugging it line by line and saw that executed, right?
lnBarID = loCT.AddKeyTimeBar(lnIndexID,; .numminute(start_time), .numminute(end_time),; .numdate(.dCurrentDate), .numdate(.dCurrentDate), booking_id) loCT.BarText(lnIndexID, lnBarID) = space(iif(layer=7 or locked,2,0))+alltrim(nvl(display_msg,'nulls present')) loCT.BarTextAlign(lnIndexID, lnBarID) = 0 &&change the look to match the properties of the lesson if layer>0 loCT.BarStyle(lnIndexID, lnBarID)=layer + iif(locked, 7, 0) + iif(notelength>0, 14, 0) endif loCT.BarBackColor(lnIndexID, lnBarID) = backcolor if backcolor=forecolor if backcolor=0 &&just so you can see it loCT.BarForeColor(lnIndexID, lnBarID) = rgb(255,255,255) else loCT.BarForeColor(lnIndexID, lnBarID) = 0 endif else loCT.BarForeColor(lnIndexID, lnBarID) = forecolor endifAlso, I see that we have BarText set in BarAdded method of the schedule as well. Not sure, if it's important or not.