XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX Unitman XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX A comfortable unit manager for the HP48 Integrates and removes units in the built-in UNITS menu system The powerful mashinery of Unitman allows to add user-defined units to the unit menus, and any unit - whether builtin or added - can be purged from the menus. You can also add or purge whole unit directories. Thus, the builtin menus can be completely reorganized. Option ExpU expands the builtin UNITS by just one additional directory for converting currencies. Other UnitDir's may be added ad libitum. Of particular interest is that the famous 3-fold functionality of unit keys scetched below works also for user defined units. The commands AddU, PurU, AUD, PUD for adding or purging units or whole unit-directories will be explained in examples. Let's first define the currency EUR (euro) in the new MONEY directory which appears in the expanded soft-menu after a first press on AddU or by pressing ExpU. MONEY contains only the (US)$ after a first run of AddU. Suppose AddU's dialog box has already been filled according to our first example as follows: XXXXXXXXXX Add a Unit XXXXXXXXXX UnitDir MONEY UnitName "EUR" Define .95_$ The UnitDir MONEY is obtained by scrolling through the UnitDirs with the menu option CHOOSE. A UnitName must be entered as a string. This allows, e.g., the creation of names like 'rot/min' (violating the names convention on the HP48). Define had to be answered in our case since EUR is unknown to the converter. Entries under Define must be units with a real before the "_". When entering the above, EUR appears in MONEY and any sum of Dollars can easily be converted into EUR and conversely, cf. below. Both $ and EUR are stored in the current directory. For use in any directory, execute AddU in HOME. European currencies with a fixed exchange are best be defined in terms of EUR. Next, we want the frequently used unit kW (kiloWatt) to appear in POWR which is number 9. This time the dialog box should look as follows: XXXXXXXXXX Add a Unit XXXXXXXXXX UnitDir POWR UnitName "kW" Define (can be skipped, need not be filled in!) The Define-option may safely be skipped because the system knows the prefix k and the unit W and hence kW, although a unit name kW did not show up in the built-in POWR menu. But with Unitman, it will. Generally, a unit deriving from existing an unit name by prefixing with D (Deco), h (hecto)... or d (deci) m (milli)... as listed in the Manual, are known to CONVERT and other commands, even if not appearing in the original menus. With AddU, you can force it to appear in the menu! Nothing is written in the HOME directory in such a case. PurU deletes a user-defined or built-in unit name from a directory. E.g, the directory TIME contains Hz on its page which is not a time unit. We put it on a second page by purging it temporarily with PurU: XXXXXXXXX Purge a Unit XXXXXXXXX UnitDir TIME UnitName "Hz" Next we add the useful ms (millisec) to the units of TIME. Finally, we re-add Hz, skipping the "Define?:" option in both cases. Then Hz appears on page 2 of TIME from now on. Other frequency units like MHz are best be added to the new created second TIME page. Note that you may purge all units you're not pleased with, e.g, miUS^2. The operating system still remembers them. While a dialog- box is open one may quietly page through the unit menus as indicated by the help text "-page UNITS", to get entries like miUS^2 into the black fields. Return to the dialog menu is possible by pressing 0 and ON, for instance. The commands AUD and DUD (Add and Delete a Unit Directory) work similiar to to the above. For instance, one may add a directory InfU for Information Units like bit, byte, KB, MB, GB etc. Define 1_bit = 1_$, 1_B = 8_bit, 1_KB = 1024_B etc. Be very careful: If the Define option is skipped in AddU, the converter would yield 1_KB = 1000_B, which is incorrect. Clearly, you may also translate the directories names into your language, copying the units from the old one to a renamed one, and then purging the old (builtin) ones with PUD. ExpU adds the MONEY directory to the builtin UnitDirs and assigns the UNIT key 74.3. RESET resets temporarily to the builtin units (without leaving the USR mode). This may be useful for inspecting the original menus after many changes have been made. A complete elimination of the expanded UNITS is possible only by purging the assignment on 74.3. Unitman's command menu is quickly invoked by holding the shift while pressing the UNITS key. Releasing the shift before pressing 74.3 sets the UNITS menu as before. Of particular importance is that user-defined unit keys operate in precisely the same way as the builtin unit keys. These acts as follows (for details see Chapter 10 of the manual): Nonshift: Appends (or multiplies) the unit to the stack object in Level 1. E.g., if 10 is on the stack then the $-key in MONEY yields 10_$. Leftshift: Converts. E.g., if EUR appears in MONEY (see above) then pressing leftshift EUR applyed to 10_$ in the stack yields 10.52..._EUR. Righshift: Divides. Rightshift $ applied to 100_Hz leaves 100 in the stack. Rightshift s "converts" 100 from the stack into 100_1/s = 100_Hz. REMARK. Be careful in chosing unit-names. E.g., the system reads a unit-name PS as 1_PegaSiemens=10^15_S. Although this unit has never been used, its name is blocked and cannot be redefined to denote any other unit. The assignment of Unitman to key 74.3 is relatively small, even for many user-unit entries. ----------------------------------------------------------------------------- Wolfgang Rautenberg raut@math.fu-berlin.de www.math.fu-berlin.de/usr/raut