MAILBAG
 
To: Gus Donnachaidh (Editor: EUG #14 - EUG #44)
From: Matthew Ford <address hidden>
Subject: VIEW MACROS
Mail Ref.: EUG #21

In answer to Micheal Harris' letter regarding VIEW Macros in EUG #20:

The reason why the page was not ejected after printing each letter was that you included a "PE Off" stored command at the start of your document. This disables not only automatic page breaks but also the PE command. If this is removed, your macro should work OK.

I have also used macros in View, but have found one major drawback: The text is formatted using the "@0", "@1", etc. labels, not the real words that they represent. This means that the text is often shunted off the right-hand side of the page when a short label (e.g @0) is replaced by a long phrase (e.g. Saturday 29th July 1995). This is not generally a problem when you are only varying the address at the top of the letter (as in Michael Harris' example), but can render the macro facility useless if they are used to vary the body of the letter. I have developed a rather long-winded way of getting around this, which I shall now describe.

First, you should prepare your standard letter as described in the User Manual, with justify mode OFF. You should include a "PB Off" command at the start of the document (not inside the macro itself). This is contrary to what I said earlier, but is essential for this method to work properly.

Any stored commands within the macro itself (not the DM and EM commands) should be replaced with the | symbol followed by the two letters of the command. For example if you want a CE stored command, you should type |CE at the start of the line where it is needed, but not in the stored command margin (I will explain this in a moment). Highlight characters (obtained by pressing FUNC-H or FUNC-J) can be used as usual if you have a printer driver. At the end of the macro, just before the EM command, you should include the line |PE, representing a Page Eject command.

Next, you must insert the characters |LJ in front of any line that would be messed up by formatting. This is basically any line which does not start with a space or Tab, and which is not part of a paragraph of text. This usually includes the "Dear Mr. Bloggs" line at the start of a letter.

Now return to command mode, and SAVE your document. Then type:

         *SPOOL temp
         SCREEN
         *SPOOL
holding down SHIFT to scroll the text up.

This text file must now be converted back into a View file so that it can be be formatted properly. I have written a program to perform this task, which is included on this disc together with its source code. The program is called CONVERT, and can be executed from View or BASIC, by the command *CONVERT. [Stored in the F(eatures) directory - Ed] Type this and enter the filename of the text file you wish to convert ("temp" in this case), followed by a filename for the output file. You may need a lot of disk space for this operation. When the program has finished converting the file, you may delete the file "temp" (but not your original document).

Now load your output file into View, and go into text mode. You will find that all of your | characters have been turned into stored commands. Set the ruler as necessary (use CAPS FUNC-, to display the default ruler if necessary), and also switch justify mode on if you want your text justified. Set the page length, top margin, header margin, header text, etc. using stored commands as usual. Go back to command mode and FORMAT the document. Check that this has not messed up any part of the document (If it has, you may need to go back to your original macro file and add some more |LJ commands).

Finally, load a printer driver if necessary, and print the document.

This may seem a rather long-winded method, but I cannot see any other way to format the documents properly. You can probably print the macros directly if all of the entries for each parameter are about the same length - just shorten the ends of the lines, and view the document using the SCREEN command until the lines are about the same length. Justifying is, I think, impossible without following the long approach. Can anyone think of a better way?

Matthew Ford, EUG #21