Loop slow? (was: Up and running!)

Andre Rombauts andre.rombauts at win.be
Sat Dec 29 07:12:00 EST 2001


>>> Just one point: it seems to be slow in loop; I'm wondering if this is real
>>> compiling... I think that accessing libraries slows down the program. Am I
>> 
>> Can you give an example of the type of loop you're using that is slow?
> 
> In fact I just investigating before starting a "real" application. I just
> made the following. With low level langauges, this loop leads to a quicker
> display.
> 
> on mouseUp
> set the text of field "info" to empty
> repeat with k = 32 to 129
> if k = 65 or k= 97 then put linefeed & linefeed after field "info"
> put numTochar(k) after field "info"
> put " " after field "info"
> end repeat
> end mouseUp

Of course this is quicker: the loop is performed 'outside' the screen
display process. But you can hear clearly the 2 beep: the loop takes some
time to run...

on mouseUp
  set the text of field "info" to empty
  beep
  repeat with k = 32 to 129
    if k = 65 or k= 97 then put linefeed & linefeed after varS
    put numTochar(k) & " " after varS
  end repeat
  beep
  set the text of field "info" to varS
end mouseUp




More information about the use-livecode mailing list