[lazarus] End of line portability
Michael Van Canneyt
michael.vancanneyt at wisa.be
Fri Aug 30 08:35:59 EDT 2002
On Fri, 30 Aug 2002, Michal Bukovjan wrote:
> 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.
More information about the Lazarus
mailing list