Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Threads in Delphi?

Status
Not open for further replies.

JasonDBurke

Programmer
Jun 20, 2001
54
US
I'm wondering how to implement a Thread in Delphi 5 that will basically execute a very long while loop and update a counter and then display that counter value in a label on the GUI. I've read the help examples but the thread setup and execution are not as intuitive to me as in VC++. Some sample code would be greatly appreciated to help me sort out this fustrating problem.
Thanx,
Jason
 
Create a global variable on your form i.e.

var
Form1 : TForm1;
MyThread : TThread;

Then when you need to create a thread. To do this, click New followed by thread object. You are required to give it a name (i.e MyThreadObject). In here you will be able to see where to enter your code.

To call your thread use

MyThread := MyThreadObject.Create(False); Arte Et Labore
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top