response.write carriage return

Results 1 to 5 of 5

Thread: response.write carriage return

  1. #1
    jmoneill Guest

    Default response.write carriage return

    I know this is a REALLY stooopid question, but...when I output my html with response.write( "...." ), it is not outputting a carriage return character. So if I view the browser source it is one huge line that wraps(this is really annoying since I go to great pains to indent my code in other languages to make it visually appealing!). I am also writing some reports wrapped in &#060;pre&#062;&#060;/pre&#062; tags so that the users can save them out to disk.<BR><BR>Because of the above two reasons, I don&#039t want to stick a &#060; br &#062;<BR> at the end of the line (it doesn&#039t work in view source, and I don&#039t want html saved out to disk). In other languages I use, I would stick a "
    " at the end of the line (Perl, C/C++), or call println (Java) to get a line terminated with &#060;cr&#062;&#060;lf&#062;.<BR><BR>I know that this has to be really basic (no pun intended), but I could not readily find response methods or write parameters to accomplish this. Anyone got any hints??<BR><BR>TIA,<BR><BR>John<BR>

  2. #2
    Join Date
    Dec 1969

    Default RE: response.write carriage return

    response.write chr(10), or <BR>response.write chr(13)<BR><BR>hope it helps<BR>jw<BR><BR><BR>

  3. #3
    Skippie Guest

    Default HINT HINT HINT!!!

    This works:<BR><BR>response.write("&#060;PRE&#062;line1 " & vbcrlf & "line2&#060;/PRE&#062;")<BR><BR>-- Skippie

  4. #4
    Skippie Guest

    Default RE: response.write carriage return

    Just in case you don&#039t know, for the PC, Chr(10) means carriage<BR>return, and Chr(13) means line feed, like in an old typewriter.<BR><BR>A MAC only uses Chr(10), and UNIX only uses Chr(13).<BR>They may be the other way around though, I forget.<BR><BR>One more thing, Chr(9) is a tab. <BR><BR>-- Skippie

  5. #5
    Ian S Guest

    Default VBNewLine

    Or you can use the VB constants vbNewline or vbCrLf<BR>vbNewLine is platform specific and VBCrLf is just <BR>chr(10) & chr(13)<BR><BR>I recommend using vbNewLine.<BR><BR>checkout for more vbscript<BR>info.<BR><BR>hope this helps,<BR>Ian

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts