base:DebugPrint()

You can post your code snippets here for others to use and learn from
Post Reply
djrikki
Posts: 682
Joined: Wed Apr 06, 2011 12:26 am

base:DebugPrint()

Post 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
Evolve - Rapid GUI Development tool for MUI Royale and RapaGUI
http://myevolve.wordpress.com
Post Reply