[Bug] Red Dot Breakpoints Ignored - Recipe

Richard Gaskin ambassador at fourthworld.com
Sat Aug 29 15:03:36 EDT 2015


Mark Wieder wrote:
> On 08/29/2015 03:53 AM, Kay C Lan wrote:
>
>> repeat with x = 1 to 10
>>      add 1 to x
>> end repeat
>> beep
>
> It's really not a good idea to try to mess with the loop index while
> it's running. Do this instead:
>
> put 1 into y
> repeat with x = 1 to 10
>    add 1 to y
> end repeat
> beep

Good catch, Mark.

We can trace out the logic of the original with:

on mouseUp
    repeat with x = 1 to 10
       put x &cr after msg
       add 1 to x
    end repeat
    beep
end mouseUp

...and get:

1
3
5
7
9


-- 
  Richard Gaskin
  Fourth World Systems
  Software Design and Development for the Desktop, Mobile, and the Web
  ____________________________________________________________________
  Ambassador at FourthWorld.com                http://www.FourthWorld.com




More information about the use-livecode mailing list