[fpc-devel]const sLineBreak

Darek Mazur darekm at emadar.com
Wed Sep 22 13:32:27 CEST 2004


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

Of course, I don't expect test of format of file. I think, this function is need 
when pass T:text to other function

My ask:
  Is SetTextLineEnding applied to readln (I can test it)


Darek


> 
> Tomas
> 
> 
> _______________________________________________
> fpc-devel maillist  -  fpc-devel at lists.freepascal.org
> http://lists.freepascal.org/mailman/listinfo/fpc-devel
> 
> 





More information about the fpc-devel mailing list