Dictionary: repeat

-hh hh at hh.on-rev.com
Sat Jul 23 11:02:45 EDT 2016


Richmond wrote
> "not recommended". If someone can explain in
> a way that makes reasonable sense ...

Predict the result of the following loop and
remove or not the "shiftkey-exit":

on mouseUp
  repeat with x = 1 to 20
    -- add -1 to x  -- not recommended
    add -4/3 to x -- not recommended
    put x into fld 1
    if the shiftkey is down then exit repeat 
  end repeat
end mouseUp

"step" is especially useful in that you can do
rather `complicated' subdivisions in a very simple way:

on mouseUp
  repeat with x = 1/13 to 1-1/13 step 1/13
    put cr & x after s
  end repeat
  put char 2 to -1 of s into fld 1
end mouseUp

To the *precedence* of step in the repeat syntax see also:
http://forums.livecode.com/viewtopic.php?f=8&t=27523




--
View this message in context: http://runtime-revolution.278305.n4.nabble.com/Dictionary-repeat-tp4706920p4706929.html
Sent from the Revolution - User mailing list archive at Nabble.com.




More information about the use-livecode mailing list