concatenation v's response.write

Discussion in 'ASP General' started by Andy, Aug 18, 2004.

  1. Andy

    Andy Guest

    Hi,

    I am a big fan of:

    var=""
    for i=0 to 100
    var=var & i
    next
    response.write i

    instead of

    for i=0 to 100
    response.write i
    next

    but I have found pages that are now advocating that using method 2 provides
    better performance as the server no longer has to resize the string and add
    stuff for each iteration. Then on the other hand other pages are telling me
    that sometimes it's OK. Not one has said one way or the other.

    Can any of you guys tell me what to do?

    Cheers,
    Andy.
    Andy, Aug 18, 2004
    #1
    1. Advertising

  2. Andy wrote:
    > Hi,
    >
    > I am a big fan of:
    >
    > var=""
    > for i=0 to 100
    > var=var & i
    > next
    > response.write i
    >
    > instead of
    >
    > for i=0 to 100
    > response.write i
    > next
    >
    > but I have found pages that are now advocating that using method 2
    > provides better performance as the server no longer has to resize the
    > string and add stuff for each iteration. Then on the other hand
    > other pages are telling me that sometimes it's OK. Not one has said
    > one way or the other.
    >
    > Can any of you guys tell me what to do?
    >
    > Cheers,
    > Andy.


    Chris Hohmann just posted a discussion about this yesterday. Let's see ...
    http://groups.google.com/groups?threadm=#

    Bob Barrows
    --
    Microsoft MVP -- ASP/ASP.NET
    Please reply to the newsgroup. The email account listed in my From
    header is my spam trap, so I don't check it very often. You will get a
    quicker response by posting to the newsgroup.
    Bob Barrows [MVP], Aug 18, 2004
    #2
    1. Advertising

  3. Andy

    Andy Guest

    >> Bob Barrows wrote:
    > Chris Hohmann just posted a discussion about this yesterday. Let's see ...
    >

    http://groups.google.com/groups?threadm=#


    Ahhhhh! I searched this group before I posted. Wood for the trees.

    Thanks for the response anyway Bob.
    Andy, Aug 18, 2004
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. walala
    Replies:
    3
    Views:
    4,784
    walala
    Sep 18, 2003
  2. Charles A. Lackman
    Replies:
    2
    Views:
    7,974
    Charles A. Lackman
    Jan 11, 2006
  3. Matthew Wieder

    Response.Write and Response.Redirect

    Matthew Wieder, Jul 17, 2003, in forum: ASP .Net
    Replies:
    4
    Views:
    675
    Kevin Spencer
    Jul 17, 2003
  4. Sehboo
    Replies:
    3
    Views:
    8,762
    Sehboo
    Dec 10, 2003
  5. Replies:
    1
    Views:
    819
Loading...

Share This Page