Sign in to follow this  
Followers 0
tuape

DebugPrint function

3 posts in this topic

Hi,

Here is a simple one liner that helps me debugging my scripts:

$test = "My test debug print"
DebugPrint($test)

; Function DebugPrint
: Outputs debug strings - use DebugView or similar to catch debug messages
Func DebugPrint($debugString)
   DllCall("kernel32.dll", "none", "OutputDebugString", "str", $debugString)
EndFunc

You can catch debug messages with DebugView

Share this post


Link to post
Share on other sites



Good catch there - If I hadn't already created a debug function, I would definately be looking into this one.


Who else would I be?

Share this post


Link to post
Share on other sites

Hi,

Here is a simple one liner that helps me debugging my scripts:

$test = "My test debug print"
DebugPrint($test)

; Function DebugPrint
: Outputs debug strings - use DebugView or similar to catch debug messages
Func DebugPrint($debugString)
   DllCall("kernel32.dll", "none", "OutputDebugString", "str", $debugString)
EndFunc

You can catch debug messages with DebugView

Minor change:

Func _dbg($sMsg)
    If @Compiled Then
        DllCall("kernel32.dll", "none", "OutputDebugString", "str", $sMsg)
    Else
        ConsoleWrite($sMsg & @CRLF)
    EndIf
EndFunc   ;==>_dbg

;Example
Global Const $bDEBUGIT = True

If $bDEBUGIT Then _dbg("Some Text")

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0