Results 1 to 8 of 8
  1. #1
    Join Date
    Nov 2003
    Location
    down on the cube farm, left then right then another left
    Posts
    467

    Unanswered: embedding a <RETURN> in a string

    Setup: 9i form on 9iDB

    I have seen this before but I can not find any examples via search.

    I want to build a string like 'line 1\nline2'. The intent is that when I display the message box it will appear as:
    line1
    line2

    All I get now is line1\nline2

    I have done this kind of thing before using to_char I believe but for the life of me can not remember what I did.
    NOTE: Please disregard the label "Senior Member".

  2. #2
    Join Date
    Aug 2003
    Location
    Where the Surf Meets the Turf @Del Mar, CA
    Posts
    7,776
    Provided Answers: 1
    ||CHR(13)||

  3. #3
    Join Date
    Jan 2004
    Location
    North Haven, CT
    Posts
    110
    'a'||chr(10)||'b'

  4. #4
    Join Date
    Nov 2003
    Location
    down on the cube farm, left then right then another left
    Posts
    467
    Yeah Team! Thanks.
    NOTE: Please disregard the label "Senior Member".

  5. #5
    Join Date
    Jul 2003
    Posts
    2,296
    yup, ansi chr(10)

    PHP Code:
      1select 'a1'||chr(10)||'a2' from dual
    15
    :50:32 platform@kod1> /

    'A1'|
    -----
    a1
    a2 
    - The_Duck
    you can lead someone to something but they will never learn anything ...

  6. #6
    Join Date
    Nov 2002
    Location
    Desk, slightly south of keyboard
    Posts
    697
    To be a pedantic old git...... think about typewriters and their successors.... teletype terminals....

    chr(13) is a carriage return (brings cursor to beginning of line. It emulated the physical act of bring the head back to left side of the paper).

    chr(10) is a linefeed (advances 'paper' up a line in the typewriter, or cursor down a line on a terminal).

    Technically you should use chr(13)||chr(10) together for the desired effect.

    *Note: Most Unix based OS's long ago dispensed (wrongly) with the pair requirement and use only one char, while windows and most other OS's still expects the pair - in that order.

    Cheers
    Bill Being Pedantic.
    Please don't email me directly with questions. I've probably just got home from the pub and cannot guarantee the sanity of my answers. In fact, I can't believe I actually made it home.

  7. #7
    Join Date
    Nov 2003
    Location
    down on the cube farm, left then right then another left
    Posts
    467
    Billm - you are a pedantic old git (and 10 years younger then I)

    I admire your knowledge and memory (maybe because I know the same :-) ).

    Regardless of what should be please note that if you insert chr(13) into a Forms display screen you get a little box. Chr(10) gives you the full "newline" sequence (linefeed & return).
    NOTE: Please disregard the label "Senior Member".

  8. #8
    Join Date
    Jul 2003
    Posts
    2,296
    Bill is probably right which makes me now realize my frustration when
    I was first trying to figure that crap out.

    I hate that little chr(13) = box thingie!!
    - The_Duck
    you can lead someone to something but they will never learn anything ...

Posting Permissions

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