[fpc-devel]const sLineBreak

Vincent Snijders vsnijders at quicknet.nl
Wed Sep 22 10:06:20 CEST 2004

Darek Mazur wrote:

> Użytkownik Tomas Hajny napisał:
>> 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

This is not really necessary. If you rewrite or append the file it has 
the System.LineEnding as line ending. You are the one who changes it 
with SetTextLineEnding and if you have done it, you know what you 
changed it to. If you haven't called SetTextLineEnding, it is still the 
default: System.LineEnding.


More information about the fpc-devel mailing list