Macro version numbers

Introduction

It is a very good idea to write a message to the log when you invoke a macro to say what macro it is and what version number of the macro it is. This is that you can find these messages in the log and if you do a later rerun then hopefully you can get hold of copies of the same version numbers of the macros. The thinking behind this and how to best do this is explained on this page.

How to increment version numbers

I haven't seen a rule written down anywhere as to how you should increment a version number but everywhere, people follow the same rule. That is, the first version number ever is version 1.0 and any small change increments the version number by a decimal place, such that small version changes that follows 1.0 are 1.1, 1.2, 1.3 etc.. If a major change happens then the version number jumps to the next highest integer such that if a major change were made to version number 1.3 then the next version number would be 2.0. Very small changes that do not affect functionality do not result in an increment of version number. A very small change might be a tidy-up of the header or adding comments or might even be fixing a bug so that the code is doing what is should be doing. So long as the functionality is not changed then code can be updated with a comment saying that the date has changed and there should be an entry in the header saying what was done. Changes should carry the initials of the programmer and the date.

When to put out the macro and version numbers

Every single macro in my collection holds the version number and date. It puts out this message before the macro is declared. Yes, you read it right. The message is put out before the macro is declared. The reason you do it that way is so that the message only appears once in the log. Suppose you had a %words macro that could get called by many other macros then you would only need to see this message once. If a message were displayed in the log every time the macro were called then it would clutter up the log without adding anything of value so it is best to just see the message once. If you put out the message before the macro is declared then the message will be written to the log only once when the macro is compiled. All my macros follow this rule. All these messages are in a consistent form such that they can be serached for in the log. See how this is done in my own %words macro by clicking on the link here.
 
 


 


Go back to the home page.

E-mail the macro and web site author.