Wait command error; all commands executed at the end

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

Post Reply
Josh1910
Posts: 19
Joined: Tue Jan 20, 2015 7:30 am

Wait command error; all commands executed at the end

Post by Josh1910 » Tue Jan 20, 2015 7:35 am

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?

SparkOut
Posts: 2947
Joined: Sun Sep 23, 2007 4:58 pm

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

Post by SparkOut » Tue Jan 20, 2015 8:38 am

First guess is to add "with messages" to the wait statements.
Second guess has yet to be formulated.

zaxos
Posts: 222
Joined: Thu May 23, 2013 11:15 pm

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

Post by zaxos » Tue Jan 20, 2015 12:51 pm

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
Knowledge is meant to be shared.

Post Reply