Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    New to the CF scene
    Join Date
    Jun 2005
    Location
    wwwroot
    Posts
    9
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question String Line returns

    Hello All,

    Does anyone know how to echo with line returns?

    Here is my code:

    Code:
    echo "<script language='JavaScript'>" .
    "var isInternetExplorer = navigator.appName.indexOf('Microsoft') != -1;" .
    "function Testbutton_DoFSCommand(command, args) {" .
    "var TestbuttonObj = isInternetExplorer ? document.all.Testbutton : document.Testbutton;" .
    "alert('Command: ' + command + ' Args: ' + args)" .
    "}" .
    "}" .
    "if (navigator.appName && navigator.appName.indexOf('Microsoft') != -1 && navigator.userAgent.indexOf('Windows') != -1 && 
    
    navigator.userAgent.indexOf('Windows 3.1') == -1) {" .
    "document.write('<script language=\"VBScript\"\>\n');" .
    "document.write('On Error Resume Next\n');" .
    "document.write('Sub Testbutton_FSCommand(ByVal command, ByVal args)\n');" .
    "document.write('	Call Testbutton_DoFSCommand(command, args)\n');" .
    "document.write('End Sub\n');" .
    "document.write('</script\>\n');" .
    "}" .
    "</script>"
    I want it to echo a line return at every [color=Red][/ " . color] at the end of each line.

    Thanks in advance,

    Xman51
    Xman51
    Area 51

  • #2
    Regular Coder
    Join Date
    Oct 2004
    Posts
    360
    Thanks
    0
    Thanked 17 Times in 17 Posts
    If you just want it printed out on seperate lines try putting \n". instead of ".

    \n is for new lines

  • #3
    Regular Coder
    Join Date
    Aug 2004
    Location
    The US of A
    Posts
    767
    Thanks
    1
    Thanked 0 Times in 0 Posts
    Actually, use \r\n.

  • #4
    God Emperor Fou-Lu's Avatar
    Join Date
    Sep 2002
    Location
    Saskatoon, Saskatchewan
    Posts
    16,987
    Thanks
    4
    Thanked 2,660 Times in 2,629 Posts
    Use Kurashu's \r\n. \n will work in most cases but server os could be configured differently:
    \n = *nix
    \r\n = Windows
    \r = Mac
    Kill all birds with one stone.


  •  

    Posting Permissions

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