Performance Problem with large file
Mark Smith
mark at maseurope.net
Sat Feb 24 20:18:28 EST 2007
Accessing fields is generally much slower than using variables, so
I'd do something like:
put fld "txtInput" into tInput
repeat for each line curLine in tInput....
I'm assuming that the function xmlWriteNewInmateRecord() writes to
the hidden field "xmlOutput".
Again, I'd write all the xml to a variable, and then put it into the
field when it's done.
put xmlWriteNewInmateRecord(idnum, lst_n, fst_n, day_in, tCount)
after tXmlOutput
....
end repeat
put "</RCATS>" & cr after tXmlOutput
put tXmlOutput into fld "xmlOutput"
Best,
Mark
On 25 Feb 2007, at 00:18, Len Morgan wrote:
>
> ######################################################################
> ###############
>
> # Clear the output field we're going to use and turn if off (for
> performance reasons)
> put empty into field "xmlOutput" put xmlFileHeader() after
> field "xmlOutput"
> set the visible of field "xmlOutput" to false
> REPEAT for each line curLine in field "txtInput"
> put the item 1 of curLine into idnum
> put item 2 of curLine into lst_n
> put item 3 of curLine into fst_n
> put item 4 of curLine into day_in
> get xmlWriteNewInmateRecord(idnum, lst_n, fst_n, day_in,
> tCount)
> get setPercentDone(tCount, ttlLines)
> put "Record " & tCount & " of " & ttlLines into field
> "progressText"
> put tCount + 1 into tCount
> END REPEAT
> # Write the closing tag
> put "</RCATS>" & cr after field "xmlOutput"
> set the visible of field "xmlOutput" to true
More information about the use-livecode
mailing list