Slow stack problem

Dick Kriesel dick.kriesel at mail.com
Tue Jul 2 04:31:13 EDT 2024



> On Jun 28, 2024, at 3:15 AM, Neville Smythe via use-livecode <use-livecode at lists.runrev.com> wrote:
> 
> I have a solution or at least a workaround

Hi, Neville. You may find a worthwhile improvement in speed if you avoid referring to the Unicode lines by their line numbers (as in "line k of fff").

Here's a way:

function findLineNumbersInUnicode pLinesToFind, tLinesToSearch -- returns a comma-delimited list of the line numbers of lines that contain any of the lines to find

  local tRegExp, tLineNumber, tLineNumbers

  repeat for each line tLineToFind in pLinesToFind

    put "(^[0-9-]*\t" & tLineToFind & ")" into tRegExp

    put 0 into tLineNumber

    repeat for each line tLine in tLinesToSearch

      add 1 to tLineNumber

      if matchChunk(tLine, tRegExp) then

        put tLineNumber & comma after tLineNumbers

      end if

    end repeat

  end repeat

  return char 1 to -2 of tLineNumbers

end findLineNumbersInUnicode



If you try the idea, please share your test results.

— Dick Kriesel


More information about the use-livecode mailing list