Got an idea for enhancing PureBasic? New command(s) you'd like to see?
-
akee
- Enthusiast

- Posts: 496
- Joined: Wed Aug 18, 2004 9:52 am
- Location: Penang, Malaysia
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:
instead of
-
mk-soft
- Always Here

- Posts: 6209
- Joined: Fri May 12, 2006 6:51 pm
- Location: Germany
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
-
#NULL
- Addict

- Posts: 1497
- Joined: Thu Aug 30, 2007 11:54 pm
- Location: right here
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

-
Little John
- Addict

- Posts: 4779
- Joined: Thu Jun 07, 2007 3:25 pm
- Location: Berlin, Germany
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

- Posts: 496
- Joined: Wed Aug 18, 2004 9:52 am
- Location: Penang, Malaysia
Post
by akee »
mk-soft + Little John = 2 x thanks!
