|
The feature allows you add or remove line numbers to the source code of a procedure, file, project or project group (the scope depends on the menu or context menu of the that you use). Line numbering is useful if you use the function in your error handlers to know the line that caused the error:
Private Sub Form_Load()
10 On Error GoTo Proc_error
20 Debug.Print 1 / 1
30 Debug.Print 1 / 0
40 Exit Sub
Proc_error:
50 MsgBox "Error " & Err.Description & " in line " & Erl & " of Form_Load"
End Sub
MZ-Tools offers the following ways to add or remove line numbers to the source code (notice that each menu has a different scope for the operation):
- The and menus: with these menus you add or remove line numbers to the source code of all the files of all the projects.
- The and context menus of a project in the of Visual Basic: with these menus you add or remove line numbers to the source code of all the files of the selected project.
- The and context menu of a file in the of Visual Basic: with these menus you add or remove line numbers to the source code of the selected file.
- The and context menus in a code window: with these menus you add or remove line numbers to the source code of the current procedure.
- The and menus on the toolbar: with these menus you add or remove line numbers to the source code of the current procedure.
- The shortcut customized in the window, tab: with this shortcut you add or remove line numbers to the source code of the current procedure.
You can customize in the window, tab, the increment used when numbering lines. Also, you can customize if unique numbers should be used when numbering a whole project (in this case the counter is not reset in each procedure).
Remarks:
- Visual Basic does not allow line numbers greater than 65535 (they are treated as 0), so MZ-Tools stops the numeration when it reaches that limit. Take this into account if you use unique numbers when numbering a whole project.
- If you want to number some line manually, use 5 characters of padding for the number plus an extra space as separator.
- Do not use the feature to remove line numbers added by another utility, since it can use other padding.
- does not allow a line number in the first of a block. If you try to add the line number by hand and you hit F5 to run the project, you get the VB error: "Statements and labels invalid between Select Case and first Case". So, MZ-Tools does not number the first of a block to avoid that VB error.
See Also:
Add Error Handler
General Customization
Shortcuts Customization
|