AV by changing top of memofield

edited January 2004 in FastReport 2.xx VCL
I use an onbeforeprint event (summaryband) with the following code
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.

Leave a Comment

Rich Text Editor. To edit a paragraph's style, hit tab to get to the paragraph menu. From there you will be able to pick one style. Nothing defaults to paragraph. An inline formatting menu will show up when you select text. Hit tab to get into that menu. Some elements, such as rich link embeds, images, loading indicators, and error messages may get inserted into the editor. You may navigate to these using the arrow keys inside of the editor and delete them with the delete or backspace key.