I would like to make use of the Feedback value in CountLinesInTextFile but I don't know how. The help just says "The type declaration TFeedbackProc defines a universal callback routine which is used in various mathematical procedures to provide feedback during time consuming calculations."

Is there an example of how to actually do this in code?

## TFeedbackProc

### Re: TFeedbackProc

Here's a code snippet which creates the feedback. Please note the
Hope this helps, Hans

**far**declaration of the feedback procedure:Code: Select all

```
(******************************************************************************)
procedure DoFeedback (Sender: TObject; StateCnt: double; PercentDone: double); far;
(******************************************************************************)
begin
FrmMain.ProgBar1.Value := (round(StateCnt/100000) mod 100);
Application.ProcessMessages;
end;
(******************************************************************************)
procedure TFrmMain.Button1Click(Sender: TObject);
(******************************************************************************)
var
IFile : TextFile;
nlin : integer;
begin
if ODiag.Execute then
begin
AssignFile (IFile, ODiag.FileName);
reset (IFile);
nlin := CountLinesInTextFile (IFile, DoFeedback);
closefile (IFile);
end;
end;
```

---

Hans Lohninger

Epina GmbH

Retz, Austria

Hans Lohninger

Epina GmbH

Retz, Austria

### Re: TFeedbackProc

Thanks, I will give that a go!