quick debug code

Share your advanced PureBasic knowledge/code with the community.
User avatar
DoubleDutch
Addict
Addict
Posts: 3220
Joined: Thu Aug 07, 2003 7:01 pm
Location: United Kingdom
Contact:

quick debug code

Post by DoubleDutch »

This macro is handy for quickly including a single line in a debug mode compile.

Code: Select all

Macro dbug(programline)
	If #PB_Compiler_Debugger
		programline
	EndIf
EndMacro

text$="in production mode"
dbug(text$="in debug mode")
MessageRequester("dbug test",text$)
https://deluxepixel.com <- My Business website
https://reportcomplete.com <- School end of term reports system
#NULL
Addict
Addict
Posts: 1499
Joined: Thu Aug 30, 2007 11:54 pm
Location: right here

Post by #NULL »

nice idea :)

..not just for single lines. (cheating :P )

Code: Select all

Macro dbug(programline)
  If #PB_Compiler_Debugger
    programline
  EndIf
EndMacro

text$="in production mode"

Macro more()
  text$="in"
  text$+" debug mode"
  text$+" mode"
EndMacro

dbug(more())
MessageRequester("dbug test",text$)
Post Reply