*&* AUTOVER-enhanced GENMENU 5.0 *&* Lisa Slater Nicholls The GENMENUL.ZIP file contains: * -- this text file * -- GENMENUL.PRG, my hacked copy of the (fixed) GENMENU.PRG * -- AUTO_VER.MNX, a sample menu to show you both ways you can create an auto-incremented version: 1) put a number in the prompt of the single menu option, and let GENMENUL increment it 2) use code in the Comment memo field of this menu option, which will be executed during the build, and which can do anything else you want. In this sample menu, since code exists in the Comment field and since this code has a special way it increments the prompt, you'll note that the code tells GENMENUL *not* to re-increment the number in the prompt, since otherwise you'd get a number that incremented by 2 each build. Code in the comment field uses the _UpdateVersion variable to accomplish this. What's the advantage of the code instead of the standard incrementing procedure? You'll see immediately, if you use the example code and place a decimal string of some sort in the prompt (try 1.a, or 1.1.1, or whatever). How do you use the results of AUTOVER? Again, there are two ways. 1) As you'll see after a build, the resulting .MPR from an AUTOVER menu isn't really a menu definition file at all. The sample one will look something like this: LPARAMETERS tcVersionString tcVersionString = "Build 5.4 [1/26/97]" This code results from the sample menu option's Procedure entry, which looks like this: LPARAMETERS tcVersionString tcVersionString = "Build 5.<> [<>]" If you wanted to use this result in your program, you might use a line like this: PRIVATE my_var DO AUTO_VER.MPR WITH my_var MyObject.BuildString = my_var && or whatever 2) As you'll see in the Comment code, you can also store the results of auto-incrementing to an outside location during the Project build (I'm storing it to an MC Framework definition application LOCALS table if one is available). This means I can assign the buildstring to my MC Framework object at the same time as this object receives all its other attributes from this table, at run time. I don't DO AUTO_VER.MPR at all. I just have to make sure that this menu file is Included in my project for the scheme to work. A couple of additional features to note: * -- the menu does not have to be called anything special. If it *is* called AUTO_VER and you use GENMENUL, GENMENUL recognizes it as an AUTOVER-type menu without further effort, but you can also use a generator directive, *:AUTOVERSION, which I've put in the sample menu's Setup code for your convenience. * -- whether you call it AUTO_VER or not, keep in mind that you'll want to have a separate auto-incrementing menu for each application in development, or your version numbers will not be kept straight! * -- the code you put in the Comment version may have nothing to do with auto-incrementing. I have successfully used this technique to pull a lot of build-time tricks on the Project Manager . * -- if you use an AUTOVER-type menu with the wrong _GENMENU during some build, don't worry, even if you've placed a DO AUTO_VER.MPR line in your code to make sure that this menu is Included in your project. If you use the sample line you'll find in the sample menu's Cleanup code, the "real" MPR you'll get from GENMENU.PRG will define a limited menu but it will RELEASE harmlessly afterwards: RELEASE PAD auto_ver OF _MSYSMENU Happy Fox Trails! >L< January 1997