Here's link that explains multi-threading with an example. Shows the two approaches, one with the Application.ProcessMessages and one with TTHreads. And an explanation of what happens if you move a window around on the screen with one compared to the other.
http://forum.codecall.net/topic/70827-very-simple-multithreading/ I've downloaded it and compiled it with Embarcadero XE5 and it works. John Dammeyer > -----Original Message----- > From: Delphi [mailto:[email protected]] On Behalf Of Tony > Foale > Sent: April-04-14 12:41 AM > To: Moderated List for the Discussion of Delphi Programming excluding > Database-related topics > Subject: Re: Exiting loop > > On 3 April 2014 10:18, John Dammeyer <[email protected]> wrote: > > > That means that within your loop only the code inside the loop is run. > > Any > > messages from devices and any screen updating is held off until you call > > windows to retrieve them. > > > > ?Many thanks for your explanation, John. Although I have been doing > engineering programming since 1960 I am not what you would term a > programmer, rather I am an engineer? who programs when I need some > software > to do specific tasks. So there are many things that are second nature to a > real programmer but which I am unfamiliar with. Such as happened in this > case. > I understand your warning about infinite loops and do not usually have > need > to use them. In this case the application reads some temperature sensors > and the loop exits normally when a threshold temp. is reached. However, > there are times when the user may what to exit before that threshold is > reached. I will look into the timer method that you suggest. I am always > happy to learn new techniques. > > Many thanks to everyone else who replied suggesting the addition of > "Application.ProcessMessages". > which has solved my problem. > > > > Regards > > Tony Foale > > > > [email protected] > http://www.tonyfoale.com > http://picasaweb.google.com/tonyfoale > https://www.facebook.com/tony.foale.5 > https://www.youtube.com/user/MotoChassis > _______________________________________________ > Delphi mailing list > [email protected] > http://lists.elists.org/cgi-bin/mailman/listinfo/delphi _______________________________________________ Delphi mailing list [email protected] http://lists.elists.org/cgi-bin/mailman/listinfo/delphi
