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