realbasic-nug
[Top] [All Lists]

Re: Quickest way to build a string?

To: REALbasic-NUG <realbasic-nug@lists.realsoftware.com>
Subject: Re: Quickest way to build a string?
From: Kem Tekinay <ktekinay@mactechnologies.com>
Date: Fri, 30 Jan 2009 08:36:11 -0500
Authentication-results: mx.google.com; spf=neutral (google.com: 74.124.194.228 is neither permitted nor denied by best guess record for domain of realbasic-nug-bounces@lists.realsoftware.com) smtp.mail=realbasic-nug-bounces@lists.realsoftware.com
Delivered-to: listarchive@realsoftware.com
In-reply-to: <4982FDC3.1070305@cowgar.com>
Reply-to: REALbasic NUG <realbasic-nug@lists.realsoftware.com>
Sender: realbasic-nug-bounces@lists.realsoftware.com
Thread-index: AcmC37afj3CBnWa3TUiCyHhmuLdmKQ==
Thread-topic: Quickest way to build a string?
User-agent: Microsoft-Entourage/12.15.0.081119
On 1/30/09 8:16 AM, "Jeremy Cowgar" <jeremy@cowgar.com> wrote:

> In your testing, that was the quickest way?

I don't know about Charles, but in my testing, without resorting to a
plug-in, that was the fastest way.

If you know ahead of time the maximum number of elements your string will
have, it might be faster to allocate the array first:

 dim arr( 10 ) as string
 arr( 0 ) = "John Doe"
 arr( 1 ) = " had "
 etc..

My guess, without having tested it, is that this is faster than using Append
as long as you don't overdue it. Dimensioning the array to, say, 1 million
elements when your string won't have more than 10 is probably slower, but
this is easy enough to test.

__________________________________________________________________________
Kem Tekinay                                                 (212) 201-1465
MacTechnologies Consulting                              Fax (914) 242-7294
http://www.mactechnologies.com                        Pager (917) 491-5546

  To join the MacTechnologies Consulting mailing list, send an e-mail to:
           mactechnologies_consulting-subscribe@yahoogroups.com









_______________________________________________
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>