Speeding a handler?

Damien Girard dam-pro.girard at laposte.net
Tue Dec 1 10:30:24 EST 2009


Hi,

Did you locked the screen ?

lock screen
put 0 into x
repeat for each line aLine of fld someFld
  add 1 to x
  if quote is in aLine then
    set the forecolor of line x of fld someFld to "red"
    replace quote with empty in line x of fld someFld
  end if
end repeat
unlock screen


Regards,

Damien Girard
Dam-pro, France.
Improve your code reusability with NativeDoc! 
http://www.dam-pro.com/nativedoc

Ton Cardona a écrit :
> I have a text field with 5.729 lines. 826 of them, those containing quotes, must appear coloured in red so the instruction would be:
>
> put 0 into x
> repeat for each line aLine of fld someFld
>   add 1 to x
>   if quote is in aLine then
>     set the forecolor of line x of fld someFld to "red"
>     replace quote with empty in line x of fld someFld
>   end if
> end repeat
>
> The problem is it takes 55 seconds.
>
> I have reduced this time to 33 seconds by recording previously the numbers of the lines to be coloured and storing them in a customProp, yet it still takes 33 seconds.
>
> Does anyone know a faster way of performing this task?
>
> Thanks in advance,
>
> Ton
>
> _______________________________________________
> use-revolution mailing list
> use-revolution at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-revolution
>
>
>   




More information about the use-livecode mailing list