gwarguitar
asked on
TThread WaitFor
I'm trying to figure out the useage of certain TThread methods.
Currently, i have 4 checkboxes, and a button.
on button click event i do
if CheckBox1.Checked then
begin
mode := 1;
thread.create(false);
end;
if CheckBox2.Checked then
begin
mode := 2;
thread.create(false);
end;
etc...
this doesn't seem to work out all that well.
how would i either
1) wait for each of the if statements to finish before moving onto the next one
or
2) wait for the thread to finish then move onto the next if statement..
i set globals in the if statements, as you can see, so unless there is a way to pass these in the call, how would you do that?
thanks!
Currently, i have 4 checkboxes, and a button.
on button click event i do
if CheckBox1.Checked then
begin
mode := 1;
thread.create(false);
end;
if CheckBox2.Checked then
begin
mode := 2;
thread.create(false);
end;
etc...
this doesn't seem to work out all that well.
how would i either
1) wait for each of the if statements to finish before moving onto the next one
or
2) wait for the thread to finish then move onto the next if statement..
i set globals in the if statements, as you can see, so unless there is a way to pass these in the call, how would you do that?
thanks!
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Is it not thread := TThread.Create(False) ?
This seems to be a popular thread information source so hopefully you might be able to gleam some information from here
http://www.midnightbeach.com/jon/pubs/MsgWaits/MsgWaits.html
gl
Mike