[fpc-devel]const sLineBreak

Michael Van Canneyt michael.vancanneyt at wisa.be
Wed Sep 15 11:17:38 CEST 2004


On Wed, 15 Sep 2004, Darek M wrote:

> >
> > On Tue, 14 Sep 2004, Darek Mazur wrote:
> >
> > > HI
> > >
> > > I need that WRITELN make the same end of line in Linux and Win32,
> > >
> > > I found sLineBreak, but for some OS it is var, for some const,
> > >
> > > There is second identifier LineEnding (mostly const)
> > >
> > > I think, tha one should be const, and second var, and when somebody need
> changes
> > > behavour of WRITELN  that he can do it.
> >
> > The purpose of this constant is not to be able to set the lineending, it
> > gives the lineending which is the default on the current platform.
>
> I know, but  why are two identifiers

One of the two is for Delphi compatibility.

If I remember correctly, LineEnding is the FPC constant.
sLineBreak comes from Delphi/Kylix

> > If you need to have the same lineending on all platforms, you must do
> > your writes yourself. I would suggest using TStreams then.
>
> I can do it, but I have to change many lines of code  (many thousand lines),
> thats trouble

I think that if your code expects the same linefeed on both platforms,
you should rethink your strategy. You should always use the 'local'
default. Opening a unix LF file in Windows gives strange results, and
vice versa too...

Michael.




More information about the fpc-devel mailing list