[fpc-pascal] Serial to TCP gateway in FPC?

Mark Morgan Lloyd markMLl.fpc-pascal at telemetry.co.uk
Thu Jun 22 10:35:29 CEST 2017


On 21/06/17 22:45, Bo Berglund wrote:

> Two issues here:1) How do I enter a loop in a GUI application? In a command lineapplication it is just going to be part of he main program code.

I'm not saying it's the right or the best way, but in the interest of 
giving you something to work with I do this:


procedure TListForm.FormCreate(Sender: TObject);

CONST   startParam= 0;

begin
..
     Application.QueueAsyncCall(@OnAfterShow, startParam) (* Keep at end *)
end { TListForm.FormCreate } ;


PROCEDURE TListForm.OnAfterShow(afterShowParam: PtrInt);

(* guaranteed to be after all form creation etc. has completed.         *)

BEGIN
..
END { TListForm.OnAfterShow } ;


That can loop, but make sure you put Application.ProcessMessages in it.

-- 
Mark Morgan Lloyd
markMLl .AT. telemetry.co .DOT. uk

[Opinions above are the author's, not those of his employers or colleagues]



More information about the fpc-pascal mailing list