By Jeff Healey c-hjr@math.utah.edu ------------------------------------------------------------------------ VIEWER2.DOC: What is it? Viewer was originally meant to view text files (instructions to programs, homework papers, .docs of all kinds) on the HP. I previously used a program called "Notecard", which is available on goodies8. Notecard would only display 22 characters per line, 7 lines at a time, and if the 22nd character was in the middle of a word, the word would be cut in half. Also, Notecard was a msdos program that would convert a text file to a HP48 program that took up considerably more memory than the original text file. I didn't like any of these things. The calculator is capable of small text that will allow up to 65 characters on a line (depending upon the characters) and up to 9 lines comfortably on the display. I therefore decided to write a program that would run on the calculator and did not have the above limitations. Viewer is also great for viewing programs. A 250 - 300 byte program will fit on just one screen without scrolling. You can view compressed files also. Anything that will not give an error when you use the "->STR" command on can be viewed with viewer. Instructions: Put what ever you want to view in level one, go to the CST menu, choose your options, and press "VIEW". The program will first "->STR" the object. Second, remove the extra spaces and unknown characters (if the option is chosen). Third, save the clean string (again, if the option is chosen). Fourth, decide how large a PICT graphic object your calculator can handle and divide the text up accordingly. And fifth, create and display the grob. If you did not have enough memory to display all of your text on one graphics object, you will need to continue by pressing the ATTN key. Scrolling the screen is done in the usual way with the arrow keys. Since this is a memory dependent program, I very strongly advise you to disable LAST STACK and LAST COMMAND. This will allow your calculator at least as much more memory as is taken up by the object you have decided to view. LAST ARGUMENT is disabled within the program, so if you happen to quit the program before it ends you will have to reset it yourself. Options: 1: Word protect: If word protect is set the words in your text will be protected from being cut in half at the end of a line (provided, of course, that the word will fit on one line). When viewing files compressed with the redundancy fighter, you will not want word protect set because there are no real words to protect and you wont want a carriage return after every space character. 2: Spaces and unknown characters removed: If the "SPCS" option is set, any string of 1 or more spaces and/or unknown characters (character numbers 0 - 32) will be removed before displaying (except for character # 10; see option 4). This can take quite some time for large files and that is the reason for the next option. 3: Save clean string: When the "SPCS" option and the "SAV" option are checked (unlike the other options, when the "SAV" option is selected it's flag number [3] will appear in the display) the string without the extra spaces and unknown characters will be saved. Purge the original file and replace it with the clean string and you will no longer have to have the extra spaces removed before displaying. The new string takes less memory also. 4: Remove returns: When the "SPCS" option and the "RTNS" option are both selected viewer will remove all character 10 hard returns. For some reason, when a text file is composed only some of the hard returns are character number 10. Others are character number 13. I noticed that leaving some hard returns will actually enhance readability. It allows you to see where the author intended for a new paragraph or section to begin. The program will always remove character number 13 when the "SPCS" option is selected, but will only remove character 10 when the "RTNS" options are selected. The default settings are: Word protect set, Extra spaces and unknown characters removed, Clean string will not be saved, All returns will be removed. If the default settings are not active you will see the 1, 2, 3, or 4 flag indicators set. Remember to reset the calculators last stack and last command options to the way that you want them when you are done. Since many people are unreasonable, the usual disclaimers apply. c-hjr@math.utah.edu akcs.spirit@hpcvbbs.cv.hp.com