Page 1 of 1

PrintN()

Posted: Wed Dec 16, 2020 9:57 am
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("")

Re: PrintN()

Posted: Wed Dec 16, 2020 2:49 pm
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


Re: PrintN()

Posted: Wed Dec 16, 2020 5:52 pm
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)

Re: PrintN()

Posted: Thu Dec 17, 2020 5:45 am
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

Re: PrintN()

Posted: Thu Dec 17, 2020 8:04 am
by akee
mk-soft + Little John = 2 x thanks! :D