[quote=291585:@Christian Schmitz]You could just have two timer, one for each process.
Than set mode to single for the other timer when one process is done.[/quote]
[quote=291588:@Maurizio Rossi]Hi Bo,
if your processes must start when the application open you can start processA in the open event of the main window.
The cleanest way is to use two timers as Christian suggested: simply set both timers in ModeSingle.
From your description your application requires a delay after completing one process before starting the other one, so use the timers to have a single action event (ModeSingle) and when a process is done simply restart the timer related to the other process.
P.S.
From the description of your program behaviour I suspect that there is something strange in your code.
Post here if you need more assistance.
Regards.[/quote]
Thank you for your reply.
I set up two timers now. Timer1 for 5 sec interval, Timer2 for 10 sec.
In Timer1 action event,
run prossess A
Timer2.Mode = Timer.ModeSingle
In Timer2 action event
run process B
My running result still has the same problem. Since Timer1 is only 5 sec and Timer2 is 10 sec, once process A finished, before process B is running, the process A will still be executed twice, which means Timer1 is continue running without waiting for Timer2 event action finishes. Because it’s a two timers system, this behavior makes sense to me, but it’s not what I want.
More confusing situation is I made another new experiment project with only one window and 1 textarea and two timers. This time the timer2 is not even been triggered. I put the sample project file at following,
link text
the code is really simple,
Window1 open action
Timer1.Enabled = True
Timer2.Enabled = True
Timer1.Mode = Timer.ModeMultiple
Timer1 action
TextArea1.AppendText ("Timer1 event starts..." + EndOfLine)
TextArea1.AppendText("process A is running..." + EndOfLine)
TextArea1.AppendText("process A finished!" + EndOfLine)
Timer2.Mode = Timer.ModeSingle
Timer2 action
TextArea1.AppendText( "timer2 event starts..." + EndOfLine)
TextArea1.AppendText("process B starts..." + EndOfLine)
TextArea1.AppendText("process B finished!" + EndOfLine + EndOfLine + EndOfLine)
I don’t know how to explain this, but I never see the text string “process B starts…” ect., only the process A is running. very strange and I’m pulling hair…