Formatted Program Manager v1.1 written in 100% SysRPL by Jack Levy jacklevy@aol.com Overview -------- Have you ever wanted to save your programs in a certain "form" or "grouping" so that it is easy to visualize while creating? It is sometimes frustrating that every time you edit a program, the structure is reset to the default. "Formatted programs" function the same, but when you edit them they are left in the exact shape and form in which you created them. In addition, editing formatted programs is much faster, as the input does not need to be converted first. FPM is a library which allows you to easily and quickly write, edit, and manage formatted source code for UserRPL programs. Full functionality is included to automate naming, file hiding, error checking, and more. Disclaimer ---------- These programs have no guarentees. They have been tested on a HP48G revision R and a HP48GX revision R with no problems. Most of the programs in this library will *NOT* work on an S/SX series calculator, due to the use of GUI applications. The others may or may not work, but I did not write these for SX's and there are no guarentees. I take no responsibility for any loss of memory or damage these programs cause to your calculator. Use at your own risk. As always, BACKUP YOUR CALCULATOR BEFORE LOADING THIS LIBRARY!! There is no way of telling if a new ROM revision may cause this library to crash. Registration ------------ This library is "Email-ware". What does this mean? If you like this program and use it regularly, you must send me an email message. (Not too steep, huh?) The idea is simple; If I know people are using this library, I will be more inclined to update it and write new programs. My internet address is jacklevy@aol.com. My CompuServe ID is 73267,235. Installation ------------ 1. Transfer the library to your HP48G/GX using Kermit/Xmodem/etc. 2. Press the soft-key associated with the library file (FPM11.LIB). "Library 1015: FPM..." should now be displayed on level1 of the stack. 3. Purge the FPM11.LIB variable, leaving the library on the stack. 4. Enter the port number you want to store the library into. Note: For G users, this number must be 0. For GX users, the library can safely be stored in any port, but it is recommended that you store it in either port 0 or 1, as execution from a covered port is slower. 5. Press STO. 6. Turn the calculator off and then on again. To access the library, press right-shift-library (2), press NXT until you see "FPM" and press the corresponding key. For those who want to make sure that the library transferred correctly, place the library on the stack and run "BYTES". The following number should appear: Checksum: #42FBh [17147d] Size: 1206 Program Usage ------------- The only user-enterable command in this library is FPM, which will bring up a menuline of options. All of FPM's features are accessed through this command, and it would therefore make things easier to assign it to a key. I suggest assigning FPM to your right-shift-PRG key. You can do this by running the following program: << { FPM } 1 GET 22.3 ASN >> Note that this key will only work when you are in USER mode (ie when USER is on top of your screen). The FPM menuline consists of 5 commands: NEW, EDIT, SRC, PURG, and INFO. Programs are stored under user-defined names, and source code is stored as .s. Program source code is hidden from view of the user in order to relieve "cluttered" directories; however, special commands have been included to purge and manage these source code files. The following is a detailed explanation of what each command does: [NEW] - Create a new program. There is a prompt for a program name, with no extension. After the prompt, you are thrown into the editor with a screen that looks something like this: C$ $ << >> The C$ $ is a special header to allow embedded strings. Never delete, change, or move this header!! If the header were removed, unpredicted results would occurr. You can now edit the program as normal, but you may format it as you wish; whatever your screen looks like at completion will be saved into a "source code" file. This file (called .S) is not visible to the user. When you are done editing, press ENTER and parsing will begin. If there is an error, the object of error will be displayed at the top of the screen, and the cursor will appear at the location of the problem. If the program is valid, it will be parsed and saved under the filename you entered originally. There is a slight pause the first time a file is saved as FPM hides the source code. Subsequent edits of the same file should not have the same pause. You can press [ON] at any time to abort the editing/creation process completely. In addition, creating a new program with the filename of an existing variable will simply overwrite the old variables. [EDIT] - Edit old programs. A full screen selection menu will appear with a list of all source code files created with [NEW]. Move the cursor with UP/DN arrow keys and press ENTER or OK to edit that program. The user will then be transferred to the internal editor with the formatted source code on screen. The C$ $ header is still there, and like before, should not be modified in any way. Functionality from here on is the same as [NEW]; ENTER will parse and save, ON will abort. [SRC] - Uncover source code files. All source code files from programs created with [NEW] will be visible to the user after pressing this key. (They will be listed at the end of the directory listing) Note that no other user-hidden variables are uncovered; only those created with FPM will show up. If you [EDIT] these programs with FPM, they will be hidden again. This function is put in incase you have "orphaned" source code files you want to account for. [PURG] - Purge source code files ONLY. A full screen selection menu will appear with a list of all source code files created with [NEW]. Move the cursor with UP/DN arrow keys and select files to be purged with the CHK menuline key. When all files are selected, press OK and purge them. Note that the actual programs are NOT purged; ONLY the source code is. [INFO] - Simple information screen with my name and email address. Removing the library -------------------- To remove the library from your HP48G/GX, do the following: 1. Enter the port ID in the form :PORT:1015 and press ENTER *TWICE* Example: If FPM is stored in port 0, enter :0:1015 DUP The port ID should now be on levels 1 and 2 of your stack. 2. Press the DETACH button (either by typing in by hand, or pressing left-shift-library, DETACH) 3. Press the PURGE key FPM should now be removed from your calculator. If you still get an "Object in use error", try turning off USER mode and switching to the HOME directory. Occasionally, if you have used FPM extensively, you may have to do a warmboot (ON-C) before it will allow you to PURGE the library. How does it work? ----------------- FPM stores each program in two files; one is a string with the formatted commands, and the other is the actual parsed program. A C$ $ prolog is given to each string so that embedded strings will not clog the program. The source code is then hidden from view using HIDEVS routines from the GxTools library. All functions recall the source code file, perform the various actions, parse the source, and then store the results back into the actual program file. To recall and purge source code files, Mika Heiskanen's VARS2 program is used to generate a composite of hidden variables. Version History --------------- [ v1.0 09/05/95 ] - Initial release of FPM. [ v1.1 10/27/95 ] - Bug fixed: EDIT, PURG, and SRC would cause a warm start if the directory had no variables. - Various code optimized and corrected. - Flashed error message now shows proper location of problem when EDITing. fpm11.lib [1015] code by jack levy [jacklevy@aol.com] dated 10/27/95, 11:12pm