Cancel Wait on CloseCard

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
istech
Posts: 211
Joined: Thu Sep 19, 2013 10:08 am

Cancel Wait on CloseCard

Post by istech » Fri Jan 31, 2014 1:08 am

I am sorry if this has been answered before I have been checking the dictionary and forums and cannot find the right command to cancel wait blocking commands for mobile.

I have looked at "exit to top" but this blocks opencard on destination cards
FlushEvents command is not supported on mobile
pendingmessages does not cancel wait command

please enlighten me if there is a better option.

(Yes I have learnt the errors of my ways and vow to start to use the send command instead of wait. :lol: )

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10333
Joined: Wed May 06, 2009 2:28 pm

Re: Cancel Wait on CloseCard

Post by dunbarx » Fri Jan 31, 2014 4:42 am

Hi.

Do you have a "wait" command in a closeCard handler? And you want to terminate that command while it is "ticking"?

I am not sure what might be different on mobile as opposed to desktop, where I live, but whatever it is there is either an answer or a rework of the schema to fix it.

Craig Newman

istech
Posts: 211
Joined: Thu Sep 19, 2013 10:08 am

Re: Cancel Wait on CloseCard

Post by istech » Fri Jan 31, 2014 9:31 am

sorry no.

I have a wait command in a open card which waits for a user input to do something.

however if the user decides to change card before inputting.

I get a warning/error from LC about it after the wait period has expired. (complaining about the something it had to do)

So in the close card I have used the cancel line 1 of item 1 method to cancel all pending messages.

But as far I know that does not include "wait" commands only for pendingmessages. Please correct me if I am wrong.

I have rewritten most to send the command to me as a custom message. (e.g send something to me in 2 seconds) But what if I wanted to use a wait command and cancel in

the closecard is this possible?

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10333
Joined: Wed May 06, 2009 2:28 pm

Re: Cancel Wait on CloseCard

Post by dunbarx » Fri Jan 31, 2014 3:01 pm

Hi.

Wait commands are blocking. They should only be used when it is your intention to force the user to take an action in a certain way. or to delay the entire system for some purpose. An "answer" dialog is one example of this sort of thing. It is a blocking process, and the only thing you can do is to click one of the buttons on it. Another example is this, in a button script:

Code: Select all

on mouseUp
  wait 20
  if the mouseClick then answer "two" else answer "one"
end mouseUp
Here we have a wait command, and the only thing that can happen during its interval is that the user might or might not click the mouse within that time period. It is a way to detect double-clicks.

When you have more than one possible user path, (as you say, the user might want to navigate to another card instead of performing the action the wait command has presented) then you need to change the way you are working your interface. Sometimes it is far better to take a different route than to try to maneuver around an existing troublesome situation.

Or am I missing your point?

Craig

istech
Posts: 211
Joined: Thu Sep 19, 2013 10:08 am

Re: Cancel Wait on CloseCard

Post by istech » Mon Feb 03, 2014 9:37 am

Lesson learnt.

Thanks.

Post Reply