wait command
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller
wait command
I can use a wait command, eg, wait until x < 10, but how do I trap the situation of x never becoming less than 10 ?
How do I execute :
wait until x < 10 but don't wait too long as other things need doing
How do I execute :
wait until x < 10 but don't wait too long as other things need doing
-
- Livecode Opensource Backer
- Posts: 61
- Joined: Tue Jan 24, 2012 10:35 am
Re: wait command
I don't really understand what you are after here, maybe you can give an example of what you are trying to use it for?
Re: wait command
Well, it seems to me that a statement like wait until x < 10 is a good way to hang a program, if for some unforeseen reason x never gets below 10. So a way of programmatically bailing out of the wait in case of a bug.
Having spent most of yesterday with hangs, crashes, and my cards getting randomly renamed, and having to reboot just to get stuff working, and then when the stack opens it goes and hits the bug again, I am wary of a wait command waiting for hell to freeze over !
Having spent most of yesterday with hangs, crashes, and my cards getting randomly renamed, and having to reboot just to get stuff working, and then when the stack opens it goes and hits the bug again, I am wary of a wait command waiting for hell to freeze over !
Re: wait command
Hi guys,
"wait until ..." is always critical, unles you implement a back door,
so you can get out of this loop-of-death if this condition never happens!
I would use something with "send"!
But need more info to give a specific advice here...
Best
Klaus
"wait until ..." is always critical, unles you implement a back door,
so you can get out of this loop-of-death if this condition never happens!
I would use something with "send"!
But need more info to give a specific advice here...
Best
Klaus
Re: wait command
Quite ! When I read the dictionary I thought you gotta be kidding ! That's such a poison pill when developing an app, there's bound to be something that stops the condition from happening.Klaus wrote:"wait until ..." is always critical, unles you implement a back door,
so you can get out of this loop-of-death if this condition never happens!
Ideally the wait command would have two parameters, the first is the condition to check for, the second is a cap on time to wait. In an ideal world, only the first parameter is needed, but when developing code, the second is critical.
-
- Livecode Opensource Backer
- Posts: 61
- Joined: Tue Jan 24, 2012 10:35 am
Re: wait command
I have to agree 100%. My first instinct was to do a or operation, but doesn't seem to allow to do this if you use both wait while and wait for. I came up with the following code, but for some reason this does not work even though I think it should:
Code: Select all
put 11 into x
put 5 into alarmTime
wait while the seconds < alarmTime or x>10
answer "broken"
-
- VIP Livecode Opensource Backer
- Posts: 9660
- Joined: Wed May 06, 2009 2:28 pm
- Location: New York, NY
Re: wait command
I suspect there is a simple and robust way to do what you want.
Can you post a simple concept script?
Craig Newman
Can you post a simple concept script?
Craig Newman
Re: wait command
So do I !dunbarx wrote:I suspect there is a simple and robust way to do what you want.
I've posted a little stack under another topic.
Thanks
Kevin
-
- VIP Livecode Opensource Backer
- Posts: 3581
- Joined: Mon Jan 22, 2007 7:36 am
- Location: Berkeley, CA, US
- Contact:
Re: wait command
Why are you posting the same thing in three different threads? This is getting annoying.
Re: wait command
One thread was about the wait statement, one about detecting end of movements. Different things.mwieder wrote:Why are you posting the same thing in three different threads? This is getting annoying.
Wasn't sure where to post the stack, so I put it in a third thread.
Quite simple, really, and I apologise for having challenged your intellect.