If you want to see the debug text from compilled Exe, use API function OutputDebugString. It has following advantages over debug.print function 1. Debug output is shown in IDE as well as when code is run outside IDE, ie when exe is run. 2. Text from two processes is shown at one place and it helps to understand the sequence of text
code sample:
Private Declare Sub OutputDebugString Lib "kernel32" Alias "OutputDebugStringA" (ByVal lpOutputString As String)
Private Sub Command1_Click() Call proc(0) End Sub
Private Function proc(no As Double) As Double If no < 1 Then OutputDebugString "Divide by zero in proc function" Exit Function End If proc = 30 / no End Function
Output: Shows debug text "Divide by zero in proc function" in Debug View window
|