Page 1 of 1

base:DebugPrint()

Posted: Wed Apr 15, 2015 11:23 pm
by djrikki
I should use this, but I never seem to. This is an enhanced DebugPrint function.

Code: Select all

Global base, application
base = {}
application = {}

application.t = "T:"
application.name = "MyApp"
application.debug = True
application.debugtofile = False

Function base:DebugPrint(message)
    If application.debug = True
        If application.debugtofile = False ; send to console window
	        debugprint(message)
	        
	    Else ; send to log file
	   		OpenFile(9,application.t .. application.name .. "_debug",#MODE_READWRITE)
	   		Seek(9,#EOF)
	   		WriteLine(9,message)
	   		CloseFile(9)
	    EndIf
    EndIf
EndFunction