Xojo Conferences
XDCMay2019MiamiUSA

Fastest append to text field? (Real Studio network user group Mailinglist archive)

Back to the thread list
Previous thread: Some questions about delegates
Next thread: HTMLViewer Options


FW: Special Valentine's Offer for Valentina - Beat the Price Increase!   -   Lynn Fredricks
  Fastest append to text field?   -   Michael Diehr
   Re: Fastest append to text field?   -   Joe Strout
   Re: Fastest append to text field?   -   Michael Diehr
   Re: Fastest append to text field?   -   Terry Ford
   Re: Fastest append to text field?   -   Kimball Larsen

Fastest append to text field?
Date: 30.11.07 19:30 (Fri, 30 Nov 2007 10:30:31 -0800)
From: Michael Diehr
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? Assume data is a single line of text.

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

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

Re: Fastest append to text field?
Date: 30.11.07 19:43 (Fri, 30 Nov 2007 11:43:56 -0700)
From: Joe Strout
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

Re: Fastest append to text field?
Date: 30.11.07 21:20 (Fri, 30 Nov 2007 12:20:41 -0800)
From: Michael Diehr
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>

Re: Fastest append to text field?
Date: 30.11.07 21:30 (Fri, 30 Nov 2007 12:30:25 -0800)
From: Terry Ford

On Nov 30, 2007, at 12:20 PM, Michael Diehr wrote:

> Ahh .AppendText must be new(ish)... very cool thx!

If Rb 2006r1 is new(ish), then I guess this applies.

It is, however, one of the many little features that got added but
didn't receive much "press coverage", so to speak. :)

Terry

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

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

Re: Fastest append to text field?
Date: 30.11.07 23:01 (Fri, 30 Nov 2007 15:01:15 -0700)
From: Kimball Larsen


On Nov 30, 2007, at 1:30 PM, Terry Ford wrote:

>
> On Nov 30, 2007, at 12:20 PM, Michael Diehr wrote:
>
>> Ahh .AppendText must be new(ish)... very cool thx!
>
> If Rb 2006r1 is new(ish), then I guess this applies.
>
> It is, however, one of the many little features that got added but
> didn't receive much "press coverage", so to speak. :)

When you've been writing stuff in RB since 4.5, then yes, 2006r1 is
newish.

I happened on this new(ish) feature a while back and have been using
it for new appends, but have not bothered to go back and update old
appends.

- Kimball
http://www.kimballlarsen.com

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

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