Setting hidden of lines very slow

Trevor DeVore lists at
Fri Nov 30 09:54:22 EST 2018

On Fri, Nov 30, 2018 at 7:08 AM Kaveh Bazargan via use-livecode <
use-livecode at> wrote:

> But here is a follow-up: Now I want to hide all lines that have no text
> style and only show lines with colored text. I use:
> repeat with i = 1 to the number of lines of fld 1
>       if the textcolor of line i of fld "text" is not empty then
>          set the hidden of line i of fld "text" to false
>       end if
>    end repeat
> This is taking time too. Any suggestions how to speed this up?

Try working with the styledText property.

put the styledText of field "text" into tTextA

# loop through paragraphs
repeat with i = 1 to the number of elements of tTextA
  # Check if first run has textcolor set
  if tTextA[i]["runs"][1]["style"]["textcolor"] is not empty then
    # hide paragraph
    put true into tTextA[i]["style"]["hidden"]
  end if
end repeat

set the styledText of fld "text" to tTextA

Trevor DeVore
CTO - ScreenSteps

More information about the use-livecode mailing list