For some reason the RebuildList Boolean in this procedure refuses to run?
I don't rightly understand exactly why but when i debug it, it skips right over the RebuildList lines.
The hints tell me Value Assigned to 'RebuildList' never used, but you can clearly see that i am using the RebuildList in the If statements?
What I am trying to do in a nut shell is when someone picks CommunionList from the ReportTpe List i want to rebuild the AttList to only show the 'Worship Service' AttList. Unless the person already selected 'Worship Service' from the list, then i do not want to rebuild the list (Thus the RebuildList boolean). The AttList is pregenerated when the form is loaded.
Anyone have any ideas?
I don't rightly understand exactly why but when i debug it, it skips right over the RebuildList lines.
The hints tell me Value Assigned to 'RebuildList' never used, but you can clearly see that i am using the RebuildList in the If statements?
What I am trying to do in a nut shell is when someone picks CommunionList from the ReportTpe List i want to rebuild the AttList to only show the 'Worship Service' AttList. Unless the person already selected 'Worship Service' from the list, then i do not want to rebuild the list (Thus the RebuildList boolean). The AttList is pregenerated when the form is loaded.
Anyone have any ideas?
Code:
procedure TAttendanceOptionsFrm.ReportTypeClick(Sender: TObject);
var
RebuildList: Boolean;
EventType: TEventTypes;
wsName, xName: string;
begin
SetDefaultDatePicker(True); //Turn on Date Picker
GetReportImage(ReportTypes.ItemIndex); //Get Report Types
EventType :=PData(Attlist.selected.Data)^.Event_Tpe; //Retrieve EventType
ReportTpe := TReportTypes(ReportTypes.ItemIndex); //Retrieve ReportTpe
if (ReportTpe = CommunionList) and (EventType <> WorshipService) and RebuildList then begin
RebuildList := False;
AttList.items.Clear;
AttList.ReadOnly:=True;
wsName:='Worship Service';
xName:='WORSHIP';
AttendUnit.MakeTheTree(wsName, xName); //Make Worship list only
end
ELSE Begin
if NOT RebuildList then begin
AttList.items.Clear;
AttendUnit.BuildEventOptions; //Rebuild full list
RebuildList := True;
end
END;
SetReportTypes; //Sets up the options available based on report you selected
if ReportTpe = Averages then
begin
SetDefaultDatePicker(False);
end;
end;