On Feb 20, 2006, at 5:30 PM, Erne wrote:


On 20-feb-06, at 22:45, Joseph J. Strout wrote:

At 10:42 PM +0100 2/20/06, Erne wrote:

this simple code is enough to freeze the app for several minutes if you put in a text with 100 or so paragraphs:

I imagine that st.Paragraph(i) is currently starting its search from the beginning each time -- solving that could be tricky, as caches can easily get outdated when you have mutable objects like these. But, maybe a simple solution would be to add a new method, st.Paragraphs, that returns all the paragraphs at once in an array.

Well, I have a similar code snippet retrieving StyleRuns instead of Paragraphs
and it didn't show the same problems


I had this same trouble a couple of months ago ( http:// support.realsoftware.com/listarchives/realbasic-nug/2005-11/ msg00206.html ) and temporarily gave up on messing with it.

But this thread made me go back, with my extra couple of months RB experience, and rewrite my methods -- skipping the Paragraph class and instead using InStr to find line endings. My benchmarking software reports that it is a gazillion times faster, and it only took me about 1/2 hour -- and I take the "rapid" out of "rapid application development".

So I think you should try that.

Ian
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>

Reply via email to