Using & _ as opposed to with for concatenating Response.


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 2 of 2

Thread: Using & _ as opposed to with for concatenating Response.

  1. #1
    Brian Guest

    Using & _ as opposed to with for concatenating Response.

    Does anyone know of any processing benefits to using the (& _ ) to
    concatenate lines in asp as opposed to using (with)?


    For example:


    Response.Write "sdlkfjsdlkfsajd" & _

    "s;lfkjasdlkfsjfklsj" & _

    "s;ldfkjadl;fkjasdljk"



    OR

    With Response

    .Write "sd;lfjd;lfkjasf;lkjsadf"

    .Write "s;lfkjadlfkjasdkfls"

    .Write "s;ldfkjsadlfk"

    End With

    Someone suggested that the object might have to be refrenced with each
    ..write but I thought this was the purpose of using with (refrenced the
    object once and the closed it with the end with)

    Thanks.



  2. #2
    Dan Stillwater Guest

    Re: Using & _ as opposed to with for concatenating Response.


    Hi Brian,

    You might want to check out the following page:
    http://www.asptoday.com/articles/20000113.htm

    It answers your question and gives you many more tips on ASP performance.



    "Brian" <bjoc1@hotmail.com> wrote:
    >Does anyone know of any processing benefits to using the (& _ ) to
    >concatenate lines in asp as opposed to using (with)?
    >
    >
    >For example:
    >
    >
    >Response.Write "sdlkfjsdlkfsajd" & _
    >
    >"s;lfkjasdlkfsjfklsj" & _
    >
    >"s;ldfkjadl;fkjasdljk"
    >
    >
    >
    >OR
    >
    >With Response
    >
    > .Write "sd;lfjd;lfkjasf;lkjsadf"
    >
    > .Write "s;lfkjadlfkjasdkfls"
    >
    > .Write "s;ldfkjsadlfk"
    >
    >End With
    >
    >Someone suggested that the object might have to be refrenced with each
    >..write but I thought this was the purpose of using with (refrenced the
    >object once and the closed it with the end with)
    >
    >Thanks.
    >
    >



Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center