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!
Hello,
I'm trying to interrupt a recurring message, but it stops many times after I click the stop button.
The stop button set a property (avvio) to false.
The problem is:
the stop button seems unclickable, but it's clickable
the result of stop button happen many times after the click, i.e. the messages is stopped many time after I click the button
I can't use send message to me in xx sec, because I don't want to loose time.
Here my code of the reccurring message (CercaFiles):
########CODE####### on mouseUp setthe avvio ofmetotrue cercafiles (field"startingFolder") end mouseUp
on CercaFiles curFolder setthedefaultFolderto curFolder putthefilesinto temp putthetextoffield"nomeFile"into nomeFile repeatforeachline tLine in temp ifthe avvio ofmeisfalsethenexittotop#here check to stop the recurring message ifmatchText(item1of tLine, nomeFile ) then put Curfolder & "/"& item1of tLine & returnafterfield"listaFiles" endif endrepeat putthefoldersinto temp2 repeatforeachline tLine2 in temp2 if tLine2 isnot"."and tLine2 isnot".."then cercaFiles(curFolder & "/" & tLine2) endif endrepeat end CercaFiles #####END OF CODE#####
Last edited by MaxV on Thu Feb 18, 2016 11:24 am, edited 1 time in total.
Livecode Wiki: http://livecode.wikia.com
My blog: https://livecode-blogger.blogspot.com
To post code use this: http://tinyurl.com/ogp6d5w
I have another button that set that property to false.
If I try to press that button, the button seems frozen; however the MouseUp is sent and is activated after 30 seconds or more that I clicked...
Livecode Wiki: http://livecode.wikia.com
My blog: https://livecode-blogger.blogspot.com
To post code use this: http://tinyurl.com/ogp6d5w
This video show the problem, I click immediately the stop button and it doesn't seem clicked, but the program is stopped 40 seconds later: https://www.youtube.com/watch?v=XxX4aNnoUr8
Livecode Wiki: http://livecode.wikia.com
My blog: https://livecode-blogger.blogspot.com
To post code use this: http://tinyurl.com/ogp6d5w
This line that seems to do nothing (wait for 0 seconds) will allow the system time to process messages from other objects... otherwise they just get queued until there is some idle time.
As for "wait 0 with messages", that was a workaround needed on OS X in earlier versions of LiveCode to accommodate an anomaly in the Mac redraw subsystem; it should never have been needed on any other platform, and with recent LiveCode builds should not be needed at all.
That this might not be needed in the future would not break legacy code.
Since I don't have any context for that sentence, I should probably let Richard respond himself.
My guess, though, is that he's referring to osx display anomalies, where the same sort of yielding to system tasks has been necessary and is no longer required due to improvements in the core graphics functionality in the engine.
That, however, has no bearing on the use of 'wait 0 with messages' in other contexts in order to yield time for queued messages.
My understanding is that the fix for the older Mac-specific need to explicitly free up clock cycles for redraws was fixed with the Cocoa changes, now part of v6.7 and later.
There's no new penalty for adding the "wait 0 with messages" workaround; it still does what it used to do in granting additional time for the OS event loop. It's just no longer needed for redraws, so now the Mac engine works on par with Windows and Linux.
Richard Gaskin LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
FourthWorld wrote:My understanding is that the fix for the older Mac-specific need to explicitly free up clock cycles for redraws was fixed with the Cocoa changes, now part of v6.7 and later.
There's no new penalty for adding the "wait 0 with messages" workaround; it still does what it used to do in granting additional time for the OS event loop. It's just no longer needed for redraws, so now the Mac engine works on par with Windows and Linux.
Windows has always needed and still does (up to 7.1.1 - not tested with 8 ) require a wait with messages inside a tight repeat loop. It's not explicitly for old Macs.