Not shy at all...

Mark Brownell gizmotron at earthlink.net
Sun Jun 6 13:19:23 EDT 2004


I don't have time to go into this in depth but here are a few speed 
mods to help you. I will comment out your code and add mine. You test 
it, I'm too busy this morning, sorry...

On Sunday, June 6, 2004, at 09:55  AM, Bob Nelson wrote:

> on mouseUp
>   put 0 into i
>   repeat forever
>     add 1 to i
>     --if char 1 of line i of field "Imported_Raw" is numToChar(13) then
>       --delete line i of field "Imported_Raw"
>       --put "Ate one return at line " & i & " of " & the number of 
> lines of
> field "Imported_Raw" & " total lines."
>       --subtract 1 from i
>     --end if
      put field "Imported_Raw" into zap
      replace return with empty in zap
      -- this way you remove all line breaks fast, then:
      replace "<br>" with return in zap
      put return & return into zingo
      replace "<p>" with zingo in zap
      -- you are using html to be converted to either some other
      -- form of html or you or stripping all the way down to readable
      -- formatted text. You can tell Rev to attempt to render the 
existing
      -- zap variable into an off screen field and then begin working 
with
      -- the results of that.
      -- like this:
      -- set the HTMLtext of field "offScreenDump" to zap
>     repeat while char 1 of line i of field "Imported_Raw" = " "
>       delete char 1 of line i of field "Imported_Raw"
>       put "Ate one space at line " & i & " of " & the number of lines 
> of
> field "Imported_Raw" & " total lines."
>     end repeat
>     if line i of field "Imported_Raw" is the last line of field
> "Imported_Raw" then
>       exit repeat
>     end if
>   end repeat

    -- I would try to do the above loop without the repeat loops if 
possible.
    -- hope this helps

>
> end mouseUp


Mark



More information about the use-livecode mailing list