Results 1 to 6 of 6

Thread: carriage return line feed

  1. #1

    Thread Starter
    Hyperactive Member Sneeden's Avatar
    Join Date
    Oct 2001
    Location
    Sneedville
    Posts
    258

    carriage return line feed

    How do I do this in JS?
    I tried something like
    PHP Code:
    var Test "line1" "\n" "line2"
    but it just put an unprintable char symbol.

  2. #2
    Member
    Join Date
    Jan 2003
    Posts
    44
    You should post your JavaScript and the context in which it is being used, because there's nothing wrong with the line you have.

  3. #3
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170
    How about:

    var Test
    Test = "line1" + "\n" + "line2";

    OR

    var Test
    Test = "line1 <BR> line2";



    ?

  4. #4

    Thread Starter
    Hyperactive Member Sneeden's Avatar
    Join Date
    Oct 2001
    Location
    Sneedville
    Posts
    258
    Well, I am using it with the MSScriptControl. The output text is not HTML. I am just sending it to a textbox object.


    VB Code:
    1. 'add the tester object
    2. frmMain.objScript.AddObject "objTester", objTesterScript, True
    3.  
    4. 'objScriptContains a textbox object.

    Now if I use VBScript like this
    VB Code:
    1. objTester.Description = "line1" & vbcrlf & "line2"
    then both lines show up in the textbox.

    However if I use JavaScript like this
    PHP Code:
    objTester.Description "line1" "\n" "line2"
    then all text appears on one line with an unprintable char between them.


    ??

  5. #5
    Member
    Join Date
    Jan 2003
    Posts
    44
    \n is the LF portion of CRLF. Try \r\n

  6. #6

    Thread Starter
    Hyperactive Member Sneeden's Avatar
    Join Date
    Oct 2001
    Location
    Sneedville
    Posts
    258
    That did the trick. Thanks a lot : )

Posting Permissions

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



Click Here to Expand Forum to Full Width