★ APPLICATIONS ★ PROGRAMMATION ★ THE VICAR ★ |
The Vicar | Applications Programmation |
It's not hard to see why lansyst has shortened the name of its 'Variables In Context Analyst and Reporter' to VICAR, but it still doesn't give much clue to its use. In fact, it's a sophisticated programming tool for anyone writing long programs in any of the main microcomputer languages, lansyst can supply VICARs for BASIC, Pascal, C or the database language dBase II, but the BASIC utility is most likely to be of use to PCW owners. What do VICARs do? The VICAR will look at one or more program files on disc and extract all references to the variables you've used in the program. It will then sort the variable names into alphabetical order and list each one followed by all the lines of your program which refer to it. The idea behind this cross-referencing is that it helps you de-bug a program by showing you where each variable is used. This may not sound much use, and is probably of limited value when the program you're developing is short. If you get really hooked on IFs, WHILEs and FORs, though, and start to develop programs commercially, you will soon find that your creations can grow extremely quickly. Many modern languages allow you to create parts of your programs as discrete units, or 'modules', and this technique helps in itself to keep track of the variables you've used. It can have a disadvantage as well, though. When your program is spread across several modules, it can take quite a while to track down the part of the program which is causing a particular error. What The VICAR does is to trace your use of different variables across as many different modules as you may have. How do VICARs do it? In its simplest form the VICAR is remarkably easy to use. You have to present it with an ASCII version of your program listing, but for all compiling languages this is fairly easy as you would normally write them on a word processor anyway. In Mallard BASIC, it's not quite so simple, as you have to save a special ASCII version using the , A option after the filename. The VICAR also requires a file telling it which program files to analyse and another if you want to exclude specific variables from the analysis. With these two pieces of information it will go away and produce a third file, containing an index of your variables. You can then display or print this analysis, which is again an ASCII file. The listing shows the VICAR analysis of one of this month's BASIC programs. As you can see it's about as long as the program itself. With longer programs the index can be up to twice as long as the program from which it's produced, and take up to four times the memory. This is perhaps its biggest disadvantage when used on the PCW, as it restricts the maximum size of program which you can process, lansyst acknowledge this themselves and it's reflected in the special Amstrad price, which in the case of the C VICAR (ship's chaplain?) is less than a quarter of the price. Verdict This is not a program for the mainstream PCW user, who is unlikely to write programs of sufficient length for it to be of great benefit. For those writing commercial applications on the machine, though, it could prove very valuable indeed. The low asking price for the Amstrad version may well provide further incentive for the inveterate hackers amongst us.
|