How to auto repeat the on mouseUp [SOLVED]
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller
Re: How to auto repeat the on mouseUp
Thanks SparkOut and I will study it as we appear to be close to a result. It could be I'm getting very tired and need to look afresh in the morning and I will get back to you.
I do thank you for your time as I'm not the sharpest knife in the draw regarding LC.
Regards,
Ruth
I do thank you for your time as I'm not the sharpest knife in the draw regarding LC.
Regards,
Ruth
Re: How to auto repeat the on mouseUp
I removed the 2 problem lines and all is now working.
However, before I go onto your If that works, then edit the on updateTheData handler with a check for valid integer value in the field
on clicking your message button this appears:-
6258,1420187535.991,updateTheData,card id 1283 of stack "C:/01 LIVE CODE/TESTXX.livecode"
Regards,
Ruth
However, before I go onto your If that works, then edit the on updateTheData handler with a check for valid integer value in the field
on clicking your message button this appears:-
6258,1420187535.991,updateTheData,card id 1283 of stack "C:/01 LIVE CODE/TESTXX.livecode"
Regards,
Ruth
Re: How to auto repeat the on mouseUp
Yes, that should be it. You were setting off an immediate updateTheData call, which set off another, which set off another until the engine gave up. You don't need to change the calculation code if you are sure there could never be anything but a single number in the field, but it would be good practice.
If you have a look at the sample stack you will also see a handler that cancels any outstanding update messages. The cancel button calls the handler, which is in the card script. This would be useful for you, since the cancel button may be pressed but an update might still be queued for quite some time.
If you have a look at the sample stack you will also see a handler that cancels any outstanding update messages. The cancel button calls the handler, which is in the card script. This would be useful for you, since the cancel button may be pressed but an update might still be queued for quite some time.
Re: How to auto repeat the on mouseUp
I have now added:-
and all is OK again except your message box still reads:
6258,1420187535.991,updateTheData,card id 1283 of stack "C:/01 LIVE CODE/TESTXX.livecode" or is that not a problem?
I will do the Cancel button after reading the Sample Stack.
Regards,
Ruth
Code: Select all
put field "EveryXMinutes" into tMins
if (tMins is not an integer) or (tMins < 1) then
put "Invalid interval" into field "EveryXMinutes"
set the cUpdatesRunning of this card to false
else
send updateTheData to this card in (tMins * 60) seconds
end if
end if
end updateTheData
6258,1420187535.991,updateTheData,card id 1283 of stack "C:/01 LIVE CODE/TESTXX.livecode" or is that not a problem?
I will do the Cancel button after reading the Sample Stack.
Regards,
Ruth
Re: How to auto repeat the on mouseUp
EDITED: The text below in italics was my mistake in that I failed to open the correct file.
Well the sample stack written by Jaqueline and Kevin no doubt in any other person's hands other than mine is an excellent reference point. However, I have failed to find/understand what I should use to replace cUpdatesRunning which is presently coded in the Cancel button, namely:-
What should I replace it with?
Regards,
Ruth
Well the sample stack written by Jaqueline and Kevin no doubt in any other person's hands other than mine is an excellent reference point. However, I have failed to find/understand what I should use to replace cUpdatesRunning which is presently coded in the Cancel button, namely:-
Code: Select all
on mouseUp
set the cUpdatesRunning of this card to false
etc etc etc
go to card "xxxx"
end mouseUp
Regards,
Ruth
Last edited by morrell on Fri Jan 02, 2015 2:47 pm, edited 1 time in total.
Re: How to auto repeat the on mouseUp
Erm, I was referring to my sample stack I attached to my post above! 
And yes, that pending message line just shows that it is working as it should. The next update is queued and only one at a time.
You can delete that button now you know the messages are working properly.

And yes, that pending message line just shows that it is working as it should. The next update is queued and only one at a time.
You can delete that button now you know the messages are working properly.
Re: How to auto repeat the on mouseUp [SOLVED]
Sorry SparkOut both files had a similar name in my learning folder and yours really was self explanatory.
I do thank you for your time and patience, it was much appreciated and I can now move on to another issue which I have yet to solve.
Kind regards,
Ruth
I do thank you for your time and patience, it was much appreciated and I can now move on to another issue which I have yet to solve.
Kind regards,
Ruth
Re: How to auto repeat the on mouseUp [SOLVED]
Ruth, do you understand the theory behind this method? It's a common way to trigger repeating events which can be generalized for many different purposes. You may need it again.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com
HyperActive Software | http://www.hyperactivesw.com
Re: How to auto repeat the on mouseUp [SOLVED]
Hello Jacqueline,
To be honest before reading what you just wrote, I would not have considered it for other repeating events and so those few words have again broadened my learning curve.
Regards,
Ruth
To be honest before reading what you just wrote, I would not have considered it for other repeating events and so those few words have again broadened my learning curve.
Regards,
Ruth
Re: How to auto repeat the on mouseUp [SOLVED]
If you have questions about what's happening, let us know and we'll explain. I not only admire your spirit, I want you to best your grandson. 

Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com
HyperActive Software | http://www.hyperactivesw.com