Link to home
Start Free TrialLog in
Avatar of PiersBull
PiersBull

asked on

End of Line Char...

Hi,
    I would like to know the end line char in Delphi. I need to insert some lines of text into a memo, each on a seperate line.
Cheers.
ASKER CERTIFIED SOLUTION
Avatar of d003303
d003303

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of PiersBull
PiersBull

ASKER

Hi ,
    Could you explain what this line is declaring :

Const
        NewLine = #10#13;
   
      Bear with me, I'm just a bit slow :`)
Cheers.

Hi,
no prob. I declared an untyped constant, so you can concatinate it with a string, a PChar or an array of char. The NewLine constant is defining two characters, Carriage Return and Line Feed (i.E. Chr(10) and Chr(13)). These are the defined charcters to force a new line in DOS/Windows. On e.g. UNIX, it is only Carriage Return without Line Feed.
Clearer right now ?

Slash/d003303
Hi again,
    When I try this, I get the 2 lines of text on the same line, separated by an end of line marker. It looks a bit like this :

Line1||Line2

whereas I want it to look like this :

Line1
Line2

Any ideas?
Cheers, Nik

Sorry, my mistake. it should read

Const
  NewLine = #13#10;

Slash/d003303
Problem solved! Cheers!
If you just want to insert lines to a memo you can use Lines.Append, like this:

mymemo.Lines.Append('Line1');
mymemo.Lines.Append('Line2');