Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2002-08

End of line portability

5 messages · 4 people ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Michael Van Canneyt
to Michal Bukovjan: is there any constant defined in FCL that would represent platform dependent end of line?…
Michal Bukovjan wrote 19 lines
Hi, is there any constant defined in FCL that would represent platform dependent end of line? I am think about something like this: {$IFDEF WIN32} const CRLF = #13#10; {$ELSE} const CRLF = #13; {$ENDIF} so that I can write things like this: lblMultiline.Text:= 'My first line' + CRLF + 'My second line'; ... and have it correctly compiled on all platforms. If not, would FCL team consider adding one?

This exists in the system unit of the FPC compiler:

 LineEnding = #10;
 LFNSupport = true;
 DirectorySeparator = '/';
 DriveSeparator = ':';
 PathSeparator = ':';
 FileNameCaseSensitive : Boolean = True;

(The example is for Unix systems)

These constants are defined for all systems, and are filled with appropriate values.

Michael.

Reply by email

Michal Bukovjan

Hi,

is there any constant defined in FCL that would represent platform dependent end of line?

I am think about something like this:

{$IFDEF WIN32}
const CRLF = #13#10;
{$ELSE}
const CRLF = #13;
{$ENDIF}

so that I can write things like this:

lblMultiline.Text:= 'My first line' + CRLF + 'My second line';

... and have it correctly compiled on all platforms. If not, would FCL team consider adding one?

Michal

Reply by email

Michael Van Canneyt
to Peter Vreman: In the development compiler the constant LineEnding is defined for this. In the stable…
Peter Vreman wrote 22 lines
> Hi, > > is there any constant defined in FCL that would represent platform > dependent end of line? > > I am think about something like this: > > {$IFDEF WIN32} > const CRLF = #13#10; > {$ELSE} > const CRLF = #13; > {$ENDIF} > > so that I can write things like this: > > lblMultiline.Text:= 'My first line' + CRLF + 'My second line'; > > .... and have it correctly compiled on all platforms. If not, would FCL > team consider adding one? In the development compiler the constant LineEnding is defined for this. In the stable 1.0.6 release there is no such define yet.

This is not correct. I copied the code from the fixbranch. So it definitely exists in both branches.

Michael.

Reply by email

Peter Vreman
Show quoted text 19 lines
Hi, is there any constant defined in FCL that would represent platform dependent end of line? I am think about something like this: {$IFDEF WIN32} const CRLF = #13#10; {$ELSE} const CRLF = #13; {$ENDIF} so that I can write things like this: lblMultiline.Text:= 'My first line' + CRLF + 'My second line'; .... and have it correctly compiled on all platforms. If not, would FCL team consider adding one?

In the development compiler the constant LineEnding is defined for this. In the stable 1.0.6 release there is no such define yet.

Reply by email

Florian Klaempfl
to Michal Bukovjan: is there any constant defined in FCL that would represent platform dependent end of line?…
you wrote 19 lines
Hi, is there any constant defined in FCL that would represent platform dependent end of line? I am think about something like this: {$IFDEF WIN32} const CRLF = #13#10; {$ELSE} const CRLF = #13; {$ENDIF} so that I can write things like this: lblMultiline.Text:= 'My first line' + CRLF + 'My second line'; ... and have it correctly compiled on all platforms. If not, would FCL team consider adding one?

LineEnding or sLinebreak in the system unit. sLinebreak is the Kylix compatible name.

Reply by email