[Implemented] PrintN() should produce #CRLF$
[Implemented] PrintN() should produce #CRLF$
Just found out that PrintN() appends a #LF$ only, which is ok for the console window output, but may cause problems when redirectied to a file.
Notepad.exe insists that lines must be terminated with CR+LF. Other editors are a little more flexible, and I don't use Notepad either, but that's why a user of my programs had to tell me about this.
Question: Why doesn't PB add #CRLF$ instead of #LF$, since on the screen there is no difference anyhow?
Notepad.exe insists that lines must be terminated with CR+LF. Other editors are a little more flexible, and I don't use Notepad either, but that's why a user of my programs had to tell me about this.
Question: Why doesn't PB add #CRLF$ instead of #LF$, since on the screen there is no difference anyhow?
Horst.
Unix/Linux use LF only, Mac used to use CR only and DOS/Windows use CRLF - I guess that's what Rings meant to sayhorst wrote:Can you please exlain what that means for the problem I posted?Rings wrote:ever think about being crossplattform ?
Good programmers don't comment their code. It was hard to write, should be hard to read.
- tinman
- PureBasic Expert
- Posts: 1102
- Joined: Sat Apr 26, 2003 4:56 pm
- Location: Level 5 of Robot Hell
- Contact:
WriteStringN() creates CRLF on Windows, I guess it uses the correct line endings for the other platforms. I don't know why PrintN() should be different from that - use the line ending for the platform it is running on.Demivec wrote:I think Rings means that CR+LF is a Windows only solution and wouldn't be considered crossplatform.horst wrote:Can you please exlain what that means for the problem I posted?
If you paint your butt blue and glue the hole shut you just themed your ass but lost the functionality.
(WinXPhSP3 PB5.20b14)
(WinXPhSP3 PB5.20b14)
- Psychophanta
- Always Here
- Posts: 5153
- Joined: Wed Jun 11, 2003 9:33 pm
- Location: Anare
- Contact:
@tinman:
> WriteStringN() creates CRLF on Windows, I guess it uses the correct line endings for the other platforms. I don't know why PrintN() should be different from that - use the line ending for the platform it is running on.
Thank you, that's the point.
@Psychophanta, Demivec:
I think it is not very realistic to ask for suppression of PrintN() and WriteStringN().
And as long as these commands exist, they should append the platform dependent EOL code.
@djes, Demivec:
I don't think, there should be an extra option (i.e. optional parameter). You can always code Print(text$ + #whatever$).
> WriteStringN() creates CRLF on Windows, I guess it uses the correct line endings for the other platforms. I don't know why PrintN() should be different from that - use the line ending for the platform it is running on.
Thank you, that's the point.
@Psychophanta, Demivec:
I think it is not very realistic to ask for suppression of PrintN() and WriteStringN().
And as long as these commands exist, they should append the platform dependent EOL code.
@djes, Demivec:
I don't think, there should be an extra option (i.e. optional parameter). You can always code Print(text$ + #whatever$).
Horst.
Actually <LF> is a Linux and Unix and BSD (which therefore presumably includes OSX) - so IMO <LF> is the standard and <CRLF> (Windows) or <CR> MacOS are the non-standard exceptions.Trond wrote:LF is a linux only solution and wouldn't be considered crossplatform either.Demivec wrote:I think Rings means that CR+LF is a Windows only solution and wouldn't be considered crossplatform.horst wrote:Can you please exlain what that means for the problem I posted?
It seems to me that Windows uses <CR> & <LF> to end a line, so while that is inefficient it should be readable all major OS's (Unix & Linux & OSX & Win)
Ta - N