[AccessD] MZ Tools
gustav at cactus.dk
Thu Jan 12 01:20:44 CST 2023
I don't use it, as I rarely write a bunch of generic code, and then I just copy-paste.
The "Review Quality" clean-up and the "Sort Code", I use, and the documentation tool which is outstanding - for example:
The single function, I use more than anything else, is the "Method Callers" option when right-clicking a function name.
Fra: AccessD <accessd-bounces+gustav=cactus.dk at databaseadvisors.com> På vegne af John Colby
Sendt: 11. januar 2023 22:23
Til: John Colby <jwcolby at gmail.com>; Access Developers discussion and problem solving <accessd at databaseadvisors.com>
Emne: [AccessD] MZ Tools
I use MZ Tools to build a consistent error handler in any function that needs one.
On Error GoTo ShowErrHandler_Error
On Error GoTo 0
Dim strErrMsg As String
Select Case Err
Case 0 'insert Errors you wish to ignore here
Case Else 'All other errors will trap
strErrMsg = "Error " & Err.Number & " (" & Err.Description & ") in procedure TestImport.Module1.ShowErrHandler, line " & Erl & "."
#If boolELE = 1 Then
Resume 0 'FOR TROUBLESHOOTING
I would love to do a thread about how each of us uses the snippets thingie in MZ Tools. I don't use the snippets mostly because I just never figured out how. MZ Tools already has a handful of snippets already assigned to their toolbar and I figured out how to modify the one that builds the error code and that is what you see above.
So what snippits do you guys use? How are snippits created? Linked to hotkeys? If anyone has a link to documentation on "how to" insert that in the thread.
My error handler is nothing special except that I build out a case in the error handler section. I do specific things related to processing errors.
#If boolELE = 1 Then
Allows me to use a compiler directive to turn on or off (compile in or out) a call to an error logger. Most probabvly do, but for those who don't...
In the editor - click tools then select the properties and a form opens which allows us to set a global (to the entire project) conditional compilation arguments. These compiler constants will affect all code throughout the project.
OTOH you can also do compiler constants that are only good inside the module in which it is defined.
#Const DebugMode = 1
Public Sub assDebugPrint(ByVal vstrMsg As String, Optional boolPrint As Boolean = False) #If DebugPrint Then
If boolPrint = True Then Debug.Print vstrMsg #End If End Sub
This allows me to turn on and off debug printing the errors in the debug window.
Soo.... that is all I do with snippits. What do you do and how do you do it?
John W. Colby
More information about the AccessD