I know I can create a constant that is #NL and depending on OS it assigns Chr(13) + Chr(10) or Chr(13) or Chr(10)...
But I think it would be a nice feature if there was a built in constant for doing this rather than adding it to my own projects every time...
Compiler defined New Line
Just have a look at the Compiler directives.
Written just out of head ...
Written just out of head ...
Code: Select all
CompilerSelect #PB_Compiler_OS
CompilerCase #PB_OS_Windows
#NL = #CRLF$
CompilerCase #PB_OS_Linux
#NL = #LF$
CompilerCase #PB_OS_MacOS
#NL = #CR$
CompilerEndIf
Check out OOP support for PB here!
Foz already said that this can be done easily, but he wants it build into PureBasicinc. wrote:Just have a look at the Compiler directives.
Written just out of head ...Code: Select all
CompilerSelect #PB_Compiler_OS CompilerCase #PB_OS_Windows #NL = #CRLF$ CompilerCase #PB_OS_Linux #NL = #LF$ CompilerCase #PB_OS_MacOS #NL = #CR$ CompilerEndIf

@Foz: +1
Windows 7 & PureBasic 4.4