I have a strange warning in compilation with Sydney 10.4.1 that I just can't understand:
procedure TWorkOrderListFrame.WorkOrderFilesGridDrawCell(Sender: TObject; ACol, ARow: Integer; Rect: TRect; State: TGridDrawState);
var
R: TRect;
C: TColor;
Value: string;
Canvas: TCanvas;
PenColor: TColor;
BrushColor: TColor;
FileIndex: Integer;
Data: TWorkOrderData;
BackgroundColor: TColor;
WorkOrdersSelectedRow: Integer;
begin
// avoids any change at header row
if ARow = 0 then Exit;
// checks and gets work order data
WorkOrdersSelectedRow := WorkOrdersGrid.Selection.Top;
if FWorkOrderManager.GetWorkOrderDataByIndex(WorkOrdersSelectedRow - 1, Data) then
// evaluates file index
FileIndex := ARow - 1;
if (FileIndex < 0) or (FileIndex >= TWorkOrderData.FILE_DATA_SIZE) then Exit;
if Data.FileData[FileIndex].FileName = '' then Exit;
// recovers canvas
Canvas := WorkOrderFilesGrid.Canvas;
[dcc64 Warning] osWorkOrderListFrame.pas(946): W1036 Variable 'FileIndex' might not have been initialized
The line with the warning is:
if (FileIndex < 0) or (FileIndex >= TWorkOrderData.FILE_DATA_SIZE) then Exit;
but FileIndex is set just the line above....
Any idea ?