Debug without any parameter to insert blank line

Got an idea for enhancing PureBasic? New command(s) you'd like to see?
User avatar
Blue
Addict
Addict
Posts: 964
Joined: Fri Oct 06, 2006 4:41 am
Location: Canada

Debug without any parameter to insert blank line

Post by Blue »

Just a timesaver:

writing
Debug
is faster than writing
Debug ""
to skip a line...

especially on some keyboards where the Quote character is not located in a convenient place,
and even more so for people who, like me, are unskilled typists !!!
PB Forums : Proof positive that 2 heads (or more...) are better than one :idea:
User avatar
DoubleDutch
Addict
Addict
Posts: 3220
Joined: Thu Aug 07, 2003 7:01 pm
Location: United Kingdom
Contact:

Post by DoubleDutch »

A nice feature would be some way of NOT printing a CR at the end of a debug message.

Maybe an optional flag?

Code: Select all

Debug("blah",#PB_No_CR)
https://deluxepixel.com <- My Business website
https://reportcomplete.com <- School end of term reports system
PB
PureBasic Expert
PureBasic Expert
Posts: 7581
Joined: Fri Apr 25, 2003 5:24 pm

Re: Debug without any parameter to insert blank line

Post by PB »

@Blue: Good request, reminds me of PRINT on the Commodore 64. :)
You can do it in the meantime with a macro:

Code: Select all

Macro Blank
  Debug ""
EndMacro

Debug "1"
Blank
Debug "2"
Blank
Debug "3"
gekkonier
User
User
Posts: 78
Joined: Mon Apr 23, 2007 9:42 am

Post by gekkonier »

Code: Select all

Debugstr.s = ""

Macro DebNL(val)
  Debug val
  Debug ""
EndMacro

Macro DebLF
  Debug ""
EndMacro

Macro Debadd(val)
  Debugstr = Debugstr + val
EndMacro

Macro Debprint
  Debug Debugstr
  Debugstr = ""
EndMacro

  

Debug("huhu")
DebLF
Debug("haha")
Debadd("a")
Debadd("b")
Debadd("c")
Debprint
DebNL("hehe")
Debug("hoho")
Quickly workaround, not good style.
User avatar
Blue
Addict
Addict
Posts: 964
Joined: Fri Oct 06, 2006 4:41 am
Location: Canada

Re: Debug without any parameter to insert blank line

Post by Blue »

PB wrote: .. reminds me of PRINT on the Commodore 64. :)
You can do it in the meantime with a macro: [...]
Reminds me of PRINT in GFABasic on my Atari1040 !!! The whole PureBsic envrironment throws me back to my Atari and GFA Basic days. Those were fun times... :wink:

Anyway, many thanks for the Macro suggestion, PB and gekkonier ; that's, of course, basiclly how i've been doing it, using only 2-letter abbreviations though: with only one good hand available to work with, I maniacally look for ways to shorten my typing... :D
PB Forums : Proof positive that 2 heads (or more...) are better than one :idea:
User avatar
Fangbeast
PureBasic Protozoa
PureBasic Protozoa
Posts: 4789
Joined: Fri Apr 25, 2003 3:08 pm
Location: Not Sydney!!! (Bad water, no goats)

Post by Fangbeast »

Blue, if you don't mind my asking, what happened to your other hand?

I've been thinking a lot about accessibility features in all my programs and only thought of the more obvious one (to me) of poor sight such as I am getting as I get older.
User avatar
Joakim Christiansen
Addict
Addict
Posts: 2452
Joined: Wed Dec 22, 2004 4:12 pm
Location: Norway
Contact:

Post by Joakim Christiansen »

DoubleDutch wrote:A nice feature would be some way of NOT printing a CR at the end of a debug message.

Maybe an optional flag?

Code: Select all

Debug("blah",#PB_No_CR)
Or have a DebugN and Debug.

I also agree with Blue :)
I like logic, hence I dislike humans but love computers.
#NULL
Addict
Addict
Posts: 1497
Joined: Thu Aug 30, 2007 11:54 pm
Location: right here

Post by #NULL »

i like the ideas here too. the Debug could have improvements in general.
i.e. auto-casting to allow things like:

Code: Select all

Debug  "result = " + function.l() + " (" + Variable.f + ")"
but probably that would be a little bit more work to implement.
Post Reply