Compiler defined New Line

Got an idea for enhancing PureBasic? New command(s) you'd like to see?
Foz
Addict
Addict
Posts: 1359
Joined: Tue Nov 13, 2007 12:42 pm
Location: Manchester, UK

Compiler defined New Line

Post by Foz »

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...
inc.
Enthusiast
Enthusiast
Posts: 406
Joined: Thu May 06, 2004 4:28 pm
Location: Cologne/GER

Post by inc. »

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 
Check out OOP support for PB here!
milan1612
Addict
Addict
Posts: 894
Joined: Thu Apr 05, 2007 12:15 am
Location: Nuremberg, Germany
Contact:

Post by milan1612 »

inc. 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 already said that this can be done easily, but he wants it build into PureBasic :wink:
@Foz: +1
Windows 7 & PureBasic 4.4
#NULL
Addict
Addict
Posts: 1497
Joined: Thu Aug 30, 2007 11:54 pm
Location: right here

Post by #NULL »

+1
(i think it was requested already)
Foz
Addict
Addict
Posts: 1359
Joined: Tue Nov 13, 2007 12:42 pm
Location: Manchester, UK

Post by Foz »

Any chance of this getting added to 4.20? Please? Pretty Please? :D
#NULL
Addict
Addict
Posts: 1497
Joined: Thu Aug 30, 2007 11:54 pm
Location: right here

Post by #NULL »

maybe if we send fred some cake :lol:
Berikco
Administrator
Administrator
Posts: 1326
Joined: Wed Apr 23, 2003 7:57 pm
Location: Belgium
Contact:

Post by Berikco »

#NULL wrote:maybe if we send fred some cake :lol:
Send SpaceCake and it will be added :twisted:
Mistrel
Addict
Addict
Posts: 3415
Joined: Sat Jun 30, 2007 8:04 pm

Post by Mistrel »

Or maybe some PureCake. :lol:
Berikco
Administrator
Administrator
Posts: 1326
Joined: Wed Apr 23, 2003 7:57 pm
Location: Belgium
Contact:

Post by Berikco »

I guess he did spacecake at least once :D

http://www.purebasic.fr/english/viewtop ... 914#230914
Post Reply