RE: newlines in ASP

by "Cyanide _7" <leo7278(at)hotmail.com>

 Date:  Fri, 12 May 2000 12:11:10 CDT
 To:  dmiles(at)ntsllc.com
 Cc:  hwg-languages(at)hwg.org
  todo: View Thread, Original
thank-you doug!
  yes vbCRLF and vbTAB both work. and after reviewing my code, i had been 
using Chr(13) and Chr(10) in reverse order, which explains the two returns. 
btw, what other vb constants exist that might come in handy? sadly enough, i 
was unaware that any existed at all! thanx again to all who replied. - 
Cyanide_7


>Use the intrinsic constant vbCRLF, which is a chr(13) (carriage return) and
>a chr(10) (line feed) in the proper order.  I've noticed that if you use 
>the
>10 and 13 in the wrong order (wrong for windows, right for unix) windows
>treats the first character as if it were a cr/lf, then processes the second
>character properly, effectively looking like each wrote its own line.
>However, when I use the constant vbCRLF, all is fine!
>
>E.g.,
>     response.write "<table>" & vbCRLF
>     response.write " <tr>" & vbCRLF
>     response.write "  <td>content</td>" & vbCRLF
>     response.write " </tr>" & vbCRLF
>     response.write "</table>" & vbCRLF
>
>Not sure, but you might try vbTab too.  I know that other characters such 
>as
>vbCR and vbLF exist, so that one might.
>
>HTH,
>--Doug
>
>
> > -----Original Message-----
> > From: owner-hwg-languages(at)hwg.org
> > [mailto:owner-hwg-languages(at)hwg.org]On
> > Behalf Of Cyanide _7
> > Sent: Friday, May 12, 2000 1:40 AM
> > To: hwg-languages(at)hwg.org
> > Subject: newlines in ASP
> >
> >
> > hi list!
> >   thanx for all the help with the DIV writing question, but
> > i'd like to
> > switch gears now as i need advise in another language. for as
> > long as i've
> > been using ASP, i've never really cared how the source i was
> > writing was
> > formatted. it had always ended up all on one to a few lines
> > because i could
> > never figure out how to create a new line in asp.
> > Response.writeln didn't
> > work and \n didn't work so i took a look at the byte level
> > and found that a
> > new line in a text editor is represented by the hex values
> > 0D-0A or decimal
> > 13-10. so i tried writing Chr(13) & Chr(10) to the Response
> > object and each
> > of them created their own new line (each being 0D-0A). so my
> > questions are:
> >
> > Is there an advantage to writing 10 vs 13 to make a newline?
> > and
> > Is there a built in method for doing this in ASP that i've overlooked?
> >
> > Similarly, i'm using Chr(9) to create a tab. is there a
> > better way to do
> > this?
> >
> > at the moment im doing something like this:
> > <%
> > Dim nl, tab
> > nl = Chr(10)
> > tab = Chr(9)
> >
> > Response.write "Hello" & nl & tab & "World!" & nl
> > %>
> >
> > TIA - Cyanide_7
> >
> >
> >
> > ______________________________________________________________
> > __________
> > Get Your Private, Free E-mail from MSN Hotmail at
>http://www.hotmail.com

________________________________________________________________________
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com

HWG: hwg-languages mailing list archives, maintained by Webmasters @ IWA