repeat with messages

Björnke von Gierke bvg at mac.com
Sat May 17 04:31:07 EDT 2014


Just for the record, there's a lot of places where you can append more code or garbage to properly formatted commands without any error, sometimes functional, sometimes not. Basically appendixes of non-functional code. All these examples compile without problem:

   split x by return and tab put comma --actually puts , into msg
   
   convert x to seconds if a
   
   if field 1 then
   end if 2 - 2

I'm sure there's others. Mark once told me that most probably won't be fixed until the dynamic language feature is implemented, because fixing them is just too work intensive.



On 17 May 2014, at 05:30, Richard Gaskin <ambassador at fourthworld.com> wrote:

> Jerry Jensen wrote:
> 
>> OK Richard, sorry for the TL;DR. Here is what I was trying to present:
>> 
>> Mark S. presented a line of code:
>> repeat with x = 100 down to 0 with messages
>> 
>> I was surprised to see, in a single line of code:
>> repeat ... WITH MESSAGES
>> which isn't in the dictionary syntax description for "repeat".
>> 
>> Mark responded:
>> The "with messages" clause makes a repeat loop non-blocking.
>> 
>> I tried it - the compiler didn't complain, and it ran. I wondered:
>> WHAT DOES THAT DO? UNBLOCK AT EACH LOOP END?
>> 
>> Then I wondered:
>> IF ITS LEGAL AND USEFUL, WHY ISN'T IT IN THE DICTIONARY?
>> 
>> Sorry for the confusion. I still wonder. Over to you.
>> .Jerry
> 
> Thanks for that, Jerry.
> 
> I've never seen "with messages" used in a repeat statement before, and in my test here it does nothing.
> 
> This:
> 
> on mouseup
>   repeat with x = 1000 down to 0 with messages
>      put x into fld 1
>   end repeat
> end mouseup
> 
> ...executes on OS X without any visible change to the field until it's done, but the common workaround of adding a "wait" command:
> 
> on mouseup
>   repeat with x = 1000 down to 0
>      wait 0 with messages
>      put x into fld 1
>   end repeat
> end mouseup
> 
> ...allows the field to be updated (on OS X; I can't stress enough that this workaround is only needed on that one platform; Linux and Windows have no such issue, and once 6.7 is released OS X won't either).
> 
> Curious that the compiler doesn't complain - maybe it just ignores everything past the stuff it can use?
> 
> A quick test proves that hypothesis:
> 
> on mouseup
>   repeat with x = 1000 down to 0 notwithstanding manbearbig
>      wait 0 with messages
>      put x into fld 1
>   end repeat
> end mouseup
> 
> ...compiles just fine, even though "notwithstanding" is of course not a keyword, and we all recognize that the ManBearPig is mythical. ;)
> 
> Bug?
> 
> The compiler's errors are generally limited to those things the engine requires to be able to tokenize a script. Ignored elements are anomalies, but apparently won't stop either compilation or execution.
> 
> Feature, perhaps? :)
> 
> 
>> PS the thread is now out of control.
> 
> Maybe, but those of us who live for LiveCode trivia like this can't get enough. :)
> 
> -- 
> Richard Gaskin
> Fourth World Systems
> Software Design and Development for the Desktop, Mobile, and the Web
> ____________________________________________________________________
> Ambassador at FourthWorld.com                http://www.FourthWorld.com
> 
> _______________________________________________
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode

--

Anyone thinking about joining on the 28. June in Zurich? 
Please send me an email!

-- 

Use an alternative Dictionary viewer:
http://bjoernke.com/bvgdocu/

Chat with other RunRev developers:
http://bjoernke.com/chatrev/






More information about the use-livecode mailing list