Page 1 of 1

Wait command error; all commands executed at the end

Posted: Tue Jan 20, 2015 7:35 am
by Josh1910
My colleague has run into this problem that has halted development of a larger program. I'm only providing a stripped version of his issue so that others may offer advice.

on mouseUp
wait 1 second
put "Time 1" into line 1 of field "Debug Field"
wait 1 second
put "Time 2" into line 2 of field "Debug Field"
wait 1 second
put "Time 3" into line 3 of field "Debug Field"
end mouseUp

Instead of executing as you would expect, all three commands are executed simultaneously after three seconds. I've seen this firsthand. To add to the puzzle, the code behaves properly when I copypaste it into my livecode. Does anyone have any idea why this is happening?

Re: Wait command error; all commands executed at the end

Posted: Tue Jan 20, 2015 8:38 am
by SparkOut
First guess is to add "with messages" to the wait statements.
Second guess has yet to be formulated.

Re: Wait command error; all commands executed at the end

Posted: Tue Jan 20, 2015 12:51 pm
by zaxos
hey there josh, folowing code seems to be working well.

Code: Select all

on mouseUp
   put empty into fld "Debug Field"
   get theTime(1)
   wait 1 sec with messages
   get theTime(2)
   wait 1 sec with messages
   get theTime(3)
   wait 1 sec with messages
end mouseUp

function theTime tNum
   put "Time"&&tNum&return after fld "Debug Field"
end theTime