Add Debug.Print to your app easy
The Debug.Print is most important as long as your program runs! If there is something wrong, error/problem, the user can always report to you what he did, by showing you the debugtext. BUT when it's compiled the user of your app. can't see the Debug.Print window!!! The thing I add (always) into my program is showed beneeth here following (simple but efficient):
AI
AI 摘要: This codebase represents a historical implementation of the logic described in the metadata. Our preservation engine analyzes the structure to provide context for modern developers.
源代码
1. make a Form called frmDebug 2. add a textbox called txtDebug (multiline+scrollbar(s)) 3. Add a Module and Copy this into the module: Option Explicit Public ShowDebugWindow As Boolean Public Function DebugPrint(DebugStr As String) If ShowDebugWindow = True Then frmDebug.Show frmDebug.txtDebug = frmDebug.txtDebug & vbCrLf & "[" & Time & "] " & DebugStr Else frmDebug.Hide End If End Function For those who read this but don't understand what to do exactly: 1. Add a Form to the project (Form1) 2. Add a button into Form1 3. (Click) Code for the button is: Private Sub Command1_Click() ShowDebugWindow = True DebugPrint "Button clicked!" End Sub when you run yer program (startup object is Form1) press the button and the DebugWindow will popup! Good Luck! http://start.at/iseekyou
原始评论 (3)
从 Wayback Machine 恢复