Moving from MZ-Tools 3.0 to 8.0 Part 12: Headers for all code elements. With one click.

Another area that has been revamped for MZ-Tools 8.0 is the headers for methods, classes, etc. In MZ-Tools 8.0 the feature is named Headers, and applies to any “code element” such as a class, module, interface, user-defined type (UDT), event, field, constant, enum, property, method, etc. That is, anything that may deserve a header to explain its purpose. In contrast, MZ-Tools 3.0 only allowed headers for files and for procedures.

The headers are defined in the “Options” window, “Team Options” tab, “Headers” section, where you can create, modify or delete as many headers as you want. You can even make them active/inactive, something useful for consultants working for several clients:

When you create a header, apart from a description and the actual header text (which can include predefined variables and user-defined variables), you select which code elements it applies to:

CodeElementHeaderEditorWhen you invoke the Insert Header feature, if there is only a single header defined for that code element, it is inserted directly. If there is more than one header that applies, you get a prompt dialog to select the desired header, with a preview below the list:

CodeElementHeaderSelectionIf the header includes user-defined variables, you are asked the values:

CodeElementHeaderUserDefinedVariablesAlso new in MZ-Tools 8.0 is the “Insert Headers” feature (do not confuse with the “Insert Header” feature, notice the final “s”), that allows you to insert headers to multiple files, to a whole project or to all projects:

CodeElementHeadersInsertionThat feature goes through all files detecting which code elements lack a header and inserts the correct one. It’s a super-fast way to document all the code elements of a project.

But that’s not all, in the next post we will talk about a related feature, the Review Headers.