Review Collections

Top  Previous  Next

The Review Collections feature allows you to review the collections of the source code. When a class file (.cls extension) is reviewed, if it contains the Item or NewEnum methods it is considered a collection. In this case, the following requirements are reviewed:

  • If it has the Item method, it must have the NewEnum method (implemented as Function or Property Get).
  • If it has the NewEnum method, it must have the Item method (implemented as Function or Property Get).
  • The NewEnum method must have the Procedure ID value -4.
  • The Item method must have the Procedure ID value 0 (Default).

MZ-Tools offers the following ways to review collections:

  • The Tools | MZ-Tools | Other Utilities | Review Collections menu: with this menu you can review the collections of all the files of all the projects.
  • The Review Collections context menu of a project in the Project Explorer of Visual Basic: with this menu you can review the collections of the selected project.
  • The Other Utilities | Review Collections menu on the MZ-Tools toolbar: with this menu you can review the collections of all the files of all the projects.
  • The shortcut customized in the Options window, Shortcuts tab: with this shortcut you can review the collections of all the files of all the projects.

The results are shown in a Results Window.

You can set the Procedure ID of a procedure moving the cursor to a line of the procedure code and clicking the Tools | Procedure Attributes... menu:

procedure_attributes

In that window, when you click the Advanced>> button an expanded window like the following is shown:

procedure_attributes_advanced

Finally, in the Procedure ID combo box you enter the value -4 for NewEnum method or you select the (Default) value of the list for the Item method.

The review of the collections can be launched automatically (or you can be asked) when you make the executable of a project, that is, clicking the File | Make Project... menu (this is customizable in the Options window, General tab). If a wrong collection is detected, the Results window keeps open (otherwise it is closed). You should fix the collections errors before making the executable.

Remarks:

  • This feature is not available in the VBA version of MZ-Tools.
  • The review is not launched when clicking the Make Project Group... menu (only when clicking the File | Make Project... menu) due to a problem with the Visual Basic IDE.

See Also:

Results Window

General Customization

Shortcuts Customization