AV by changing top of memofield
I use an onbeforeprint event (summaryband) with the following code
Everything goes fine, until Totaal.top has to be changed ... I received an AV at adress DA8BFFE0 ... and my debugger halts on FR_Utils
After the AV i will get a good result on my report ... And last but not least if I only run the exe, no AV is generated ...
This is really weird!
Can somebody tell me what's going on!
Thx in advance
F.
begin
? if not [BuitenBestek] then
? Begin
? buitenbestek.visible := False;
? buitenbestekx.visible := False;
? winstmarge.visible := False;
? winstmargex.visible := False;
? Coef.Top := buitenbestek.Top;
? CoefX.Top := Coef.Top;
? ExBTW.Top := winstmarge.Top;
? ExBTWX.Top := ExBTW.Top;
? BTW.Top := BTW.Top -24;
? BTWX.Top := BTW.Top;
? Totaal.Top := Totaal.Top -24;
? TotaalX.Top := Totaal.Top;
? end
end
Everything goes fine, until Totaal.top has to be changed ... I received an AV at adress DA8BFFE0 ... and my debugger halts on FR_Utils
function FindField(ds: TfrTDataSet; FName: String): String;
? var
? ? sl: TStringList;
begin
? ? Result := '';
? ? if ds <> nil then
? ? begin
? ? ? sl := TStringList.Create;
? ? ? frGetFieldNames(ds, sl);
? ? ? if sl.IndexOf(FName) <> -1 then <-------------------------------- AV !!!
? ? ? ? Result := FName;
? ? ? sl.Free;
? ? end;
end;
After the AV i will get a good result on my report ... And last but not least if I only run the exe, no AV is generated ...
This is really weird!
Can somebody tell me what's going on!
Thx in advance
F.