PrintN()

Got an idea for enhancing PureBasic? New command(s) you'd like to see?
akee
Enthusiast
Enthusiast
Posts: 496
Joined: Wed Aug 18, 2004 9:52 am
Location: Penang, Malaysia

PrintN()

Post by akee »

Fred,
Possible to change PrintN() to default to an empty string?

Then when we want to add a line, we can type:

Code: Select all

PrintN()
instead of

Code: Select all

PrintN("")
User avatar
mk-soft
Always Here
Always Here
Posts: 6209
Joined: Fri May 12, 2006 6:51 pm
Location: Germany

Re: PrintN()

Post by mk-soft »

Code: Select all

Macro _PB_(Function)
  Function
EndMacro

Macro PrintN(text="")
  _PB_(PrintN)(text)
EndMacro

If OpenConsole()
  PrintN("Hello")
  PrintN()
  PrintN("World")
  Input()
EndIf

My Projects ThreadToGUI / OOP-BaseClass / EventDesigner V3
PB v3.30 / v5.75 - OS Mac Mini OSX 10.xx - VM Window Pro / Linux Ubuntu
Downloads on my Webspace / OneDrive
#NULL
Addict
Addict
Posts: 1497
Joined: Thu Aug 30, 2007 11:54 pm
Location: right here

Re: PrintN()

Post by #NULL »

Haha, nice mk-soft. I didn't know that works in PB. I would have used an additional Procedure to call PrintN from within the macro. Thanks 8)
Little John
Addict
Addict
Posts: 4779
Joined: Thu Jun 07, 2007 3:25 pm
Location: Berlin, Germany

Re: PrintN()

Post by Little John »

That can be made even simpler. :-)

Code: Select all

Macro PrintN (text="", Function=PrintN)
   Function(text)
EndMacro

If OpenConsole()
   PrintN("Hello")
   PrintN()
   PrintN("World")
   Input()
EndIf
akee
Enthusiast
Enthusiast
Posts: 496
Joined: Wed Aug 18, 2004 9:52 am
Location: Penang, Malaysia

Re: PrintN()

Post by akee »

mk-soft + Little John = 2 x thanks! :D
Post Reply