Debug object?

Wakane
11-11-2002, 07:42 PM
Hi, All!

I always use the debug object. Something like

Debug.Print "Variable a is now" + a

or something like that.

When I deploy the app, I'd like to redirect this debug into a log file instead. Is there any way I can do that directly or at least with minimal effort. Or do I have to create my own class/methods in order to do that?

Spike
11-11-2002, 07:58 PM
You can just make a function, and call it when you need it..here is one from one of my programs.


Sub WriteToLog(WriteWhat$)
Dim FileNumber& 'get a free file number
FileNumber = FreeFile
'open it as append
Open App.Path & "\mud.log" For Append Shared As #FileNumber
'add a line to it

Print #FileNumber, "[" & Date & "|" & Time & "] - " & WriteWhat$
Close #FileNumber 'close the file
End Sub


Just call like
WriteToLog "Variable a is now " & a

Wakane
11-11-2002, 09:10 PM
Thanks, mate!

I was actually looking for a way not to create a method/class, but I guess I have to :(

Anyway I'd probably create a good debug class that I can use.

Thanks for code!

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum