[fpc-devel]const sLineBreak

Tomas Hajny XHajT03 at mbox.vol.cz
Wed Sep 22 11:08:24 CEST 2004

On Wed, 22 Sep 2004 11:51:06 +0200, Darek Mazur wrote
> Użytkownik Tomas Hajny napisał:
> > From:           	Darek Mazur <darekm at emadar.com>
> > Date sent:      	Thu, 16 Sep 2004 16:52:54 +0200
> > A new procedure SetTextLineEnding (var T: text; S: string) was added 
> > to System unit in CVS. This allows you to change line ending for 
> > individual text files. After call to Assign the line ending for that 
> > file is set to the default line ending on your platform, then you can 
> > change the default value using the newly provided procedure - since 
> > that time all WriteLn calls will use your new value. Changing the 
> > default value system-wide would be dangerous because of output to 
> > console, redirection, libraries possibly expecting particular 
> > behaviour etc.
> That is better solution, than I think .
> But is function like
>     GetTextLineEnding(vat T: text): string
> I don check CVS yet

Such a function can be added, of course, but keep in mind that it will only
return the value you assigned to it yourself (as already mentioned by
Vincent). Don't expect that it would be able to determine the used line ending
type in existing files while reading them - this is not possible (among other
reasons, you are never guaranteed to have uniform line endings throughout the
whole existing file).


More information about the fpc-devel mailing list