Wait command in simulator...

Getting into LiveCode for iOS? Ask your questions here.

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
rrBUSS9EE
Posts: 98
Joined: Wed May 02, 2012 3:46 pm

Wait command in simulator...

Post by rrBUSS9EE » Mon May 07, 2012 5:37 pm

Hi all,

Is it just me or does the wait command not behave as expected in iOS (the sim in my case). Seems whenever I have a wait command anywhere in the stack opening message sequence (openCard for instance), nothing happens (cards don't draw for instance) until the period spec'd in the wait command passes.

I know there is "send after time" but is this just a bug or is there some difference in the systems' handling of this command I should be aware of.

Thanks!

Mark
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 5150
Joined: Thu Feb 23, 2006 9:24 pm
Contact:

Re: Wait command in simulator...

Post by Mark » Mon May 07, 2012 8:53 pm

Hi,

I'd say this is not a bug. The wait command, without "with messages" blocks the engine completely. Wait with messages works normally as far as I can tell.

Kind regards,

Mark
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode

rrBUSS9EE
Posts: 98
Joined: Wed May 02, 2012 3:46 pm

Re: Wait command in simulator...

Post by rrBUSS9EE » Mon May 07, 2012 10:55 pm

Ok…

In card 1 of a stack…

Code: Select all

on openCard
  wait 3 seconds
end openCard
No other script execution.

On the desktop… cd 1 is displayed for 3 seconds and then card 2 is displayed.

In iOS SIM, you see a blacked out screen for 3 seconds, and then the card 2 is displayed.

Are you suggesting this is expected behavior? If so, why the difference between the two platforms?

Mark
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 5150
Joined: Thu Feb 23, 2006 9:24 pm
Contact:

Re: Wait command in simulator...

Post by Mark » Tue May 08, 2012 12:22 am

Hi,

Do you have any other scripts besides

Code: Select all

on openCard
  wait 3 seconds
end openCard
?

What you describe isn't exactly expected behaviour, but I would never do it this way. The wait command, without "with messages", blocks the engine completely and I can very well understand that it also prevents the engine from drawing the card under specific circumstances. Just use "with messages".

Kind regards,

Mark
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode

rrBUSS9EE
Posts: 98
Joined: Wed May 02, 2012 3:46 pm

Re: Wait command in simulator...

Post by rrBUSS9EE » Tue May 08, 2012 12:32 am

Sorry… left out the line under the wait command to "go next".

To be clear, I am not doing it this way, instead using the send command. I just stumbled across it and thought I would ask if it was expected. Since it is a supported feature on all platforms, and it works differently on one platform vs another, I would consider it unexpected.

jacque
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 7390
Joined: Sat Apr 08, 2006 8:31 pm
Contact:

Re: Wait command in simulator...

Post by jacque » Tue May 08, 2012 7:55 pm

It sounds like the card is drawn only after the opencard handler finishes on iOS. I agree that adding "with messages" to the "wait" command could fix it. The difference is likely a limitation in iOS.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

jmburnod
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 2729
Joined: Sat Dec 22, 2007 5:35 pm
Contact:

Re: Wait command in simulator...

Post by jmburnod » Tue May 08, 2012 9:53 pm

Hi Mark
The wait command, without "with messages" blocks the engine completely
I have some wait without "with messages" (for repeat with) and they work fine for me on simulator and iPad.

Something i didn't understand ?

Best regards

Jean-Marc
https://alternatic.ch

mwieder
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3581
Joined: Mon Jan 22, 2007 7:36 am
Contact:

Re: Wait command in simulator...

Post by mwieder » Tue May 08, 2012 10:06 pm

It seems that the "problem" is the use of the wait command in the openCard handler. From what I can gather, it appears that the card is being drawn on the screen at the beginning of the openCard handler on the desktop, and at the end of the openCard handler in iOS. Whether or not this is a bug is subjective. Without the "with messages" clause, the openCard handler will be unable to proceed, and the card on iOS will not be drawn until the wait period is over. It's probably worth filing a bug on this to bring the platforms to parity, but as Mark points out, just use the "with messages" format as a workaround.

rrBUSS9EE
Posts: 98
Joined: Wed May 02, 2012 3:46 pm

Re: Wait command in simulator...

Post by rrBUSS9EE » Wed May 09, 2012 12:30 am

mwieder wrote:probably worth filing a bug on this to bring the platforms to parity
How does one do this… it seems I have found a number of them. (c:

mwieder
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3581
Joined: Mon Jan 22, 2007 7:36 am
Contact:

Re: Wait command in simulator...

Post by mwieder » Wed May 09, 2012 12:49 am

<rant>
unfortunately, runrev has removed the ability for mere mortals to file bug reports.
send a bug report email to support@runrev.com and someone will enter it into the system.
</rant>

paulsr
Posts: 222
Joined: Thu Jul 19, 2012 9:47 am
Contact:

Re: Wait command in simulator...

Post by paulsr » Tue Sep 04, 2012 11:53 am

I've just encountered this same problem.

It does seem like, on the iOS Simulator, the whole openCard script executes before anything is displayed.

I am trying to fade-in a menu by changing the blendlevel in a loop, but the loop completes before the card is displayed, and so the fade-in is not seen.

--paul

Klaus
Posts: 14182
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: Wait command in simulator...

Post by Klaus » Tue Sep 04, 2012 12:12 pm

Hi guys,

1. the correct email address for bugs is in fact: bugs@runrev.com
2. if "wait" in an "opencard" handler is making trouble, well, then don''t combine them :D

Try something like this:

Code: Select all

on opencard
  ## your other stuff here...

  ## Give the hanlder time to complete/draw the card and THEN do your stuff:
  send "do_the_menu_fade" to me in 1
end opencard

command do_the_menu_fade
  ## do your menu fade or whatever here

  wait X secs with messages
  go next cd
end do_the_menu_fade
Best

Klaus

paulsr
Posts: 222
Joined: Thu Jul 19, 2012 9:47 am
Contact:

Re: Wait command in simulator...

Post by paulsr » Tue Sep 04, 2012 12:38 pm

Thanks Klaus.

That's a good solution to the "wait" problem.

And "wait" commands do work if they are inside the do_the_menu_fade command script.

So, I can make ten menu buttons appear one after another, by placing a short wait between each fade-in.

But, I cannot make the fade work. The menu buttons just pop into view. My code looks like...

Code: Select all

put 100 into t_count
repeat while t_count >= 0
   set the blendlevel of btn "BtnMenu2" to t_count
   put t_count - 1 into t_count
end repeat
That would normally be a very slow fade, but as I say, no fade is visible.

Any ideas?

TIA

--paul

Klaus
Posts: 14182
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: Wait command in simulator...

Post by Klaus » Tue Sep 04, 2012 12:47 pm

Hi Paul,

try to "lock screen":

Code: Select all

repeat while t_count >= 0
   lock screen
   set the blendlevel of btn "BtnMenu2" to t_count
   unlock screen
   put t_count - 1 into t_count
end repeat
Best

Klaus

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10044
Joined: Sat Apr 08, 2006 7:05 am
Contact:

Re: Wait command in simulator...

Post by FourthWorld » Tue Sep 04, 2012 3:59 pm

mwieder wrote:<rant>
unfortunately, runrev has removed the ability for mere mortals to file bug reports.
send a bug report email to support@runrev.com and someone will enter it into the system.
</rant>
Sounds like an easier way to submit bug reports than dealing with Bugzilla's UI directly. :)
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn

Post Reply