realbasic-nug
[Top] [All Lists]

Re: Fastest append to text field?

To: REALbasic NUG <realbasic-nug at lists dot realsoftware dot com>
Subject: Re: Fastest append to text field?
From: Michael Diehr <md03 at xochi dot com>
Date: Fri, 30 Nov 2007 12:20:41 -0800
Delivered-to: listarchive at realsoftware dot com
Delivered-to: realbasic-nug at lists dot realsoftware dot com
References: <D9A600C7-A072-4F7E-96A6-672D46EE7345 at xochi dot com> <A452764E-5A1A-4331-822F-8B40CED1642B at inspiringapps dot com>
Ahh .AppendText must be new(ish)... very cool thx!

On Nov 30, 2007, at 10:43 AM, Joe Strout wrote:

> On Nov 30, 2007, at 11:30 AM, Michael Diehr wrote:
>
>> If you have text field which serves as a log, what's the fastest way
>> to append to it?
>>
>> either
>>   editField.SelStart = editField.text.Len
>>   editField.SelText = data + EndOfLine
>>
>> or
>>   editField.text = editField.text + data + EndOfLine
>>
>> e.g is it faster to Insert using .SelText, or to just replace the
>> whole .Text object?
>
> No!  Instead, use EditField.AppendText.  That's what it's for; it
> will not only be faster, but also avoid screwing up the selection and
> scroll position.
>
> Best,
> - Joe
>
> --
> Joe Strout
> Inspiring Applications, Inc.
> http://www.InspiringApps.com
>
>
>
> _______________________________________________
> Unsubscribe or switch delivery mode:
> <http://www.realsoftware.com/support/listmanager/>
>
> Search the archives:
> <http://support.realsoftware.com/listarchives/lists.html>

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

Search the archives:
<http://support.realsoftware.com/listarchives/lists.html>


<Prev in Thread] Current Thread [Next in Thread>