From comp.sys.handhelds Fri Feb 8 13:01:27 1991 Path: mentor.cc.purdue.edu!noose.ecn.purdue.edu!samsung!dali.cs.montana.edu!uakari.primate.wisc.edu!zaphod.mps.ohio-state.edu!swrinde!elroy.jpl.nasa.gov!sdd.hp.com!hp-pcd!hpcvra.cv.hp.com!rnews!hpcvbbs!akcs.joehorn From: akcs.joehorn@hpcvbbs.UUCP (Joseph K. Horn) Newsgroups: comp.sys.handhelds Subject: HP 48SX GETKEY (fetch single key's defin Keywords: 48 getkey definition assignment Message-ID: <27b254e4:1993comp.sys.handhelds@hpcvbbs.UUCP> Date: 8 Feb 91 07:40:08 GMT Lines: 49 GETKEY, by Joseph K. Horn Here's a useful utility for fetching a single key definition, very much like FETCH KEY on the HP 71. The following RPL routine works instantly. Shifted, alpha, and shifted alpha keys all work. The only key it won't fetch is ATTN, which is used to exit the program if desired. INSTRUCTIONS: Run it, then press any key. Its definition will be recalled to the stack, with its keycode above it. It is most useful when assigned to a key; fetching a key definition only takes two keystrokes then. RPL listing of GETKEY: 02D9D Begin program object 2A2B4 0; for 0 WAIT construct 1A738 Internal WAIT; pause until key press; return rc.p keycode 03188 Internal DUP; float keycode until the end 41CA2 Convert rc.p keycode into system keycodes 41F3F Recall contents of UserKeys var to the stack 03295 Internal ROT --> { UserKeys } 056B6 Internal GET --> { all 6 definitions on that key } True 03244 Internal DROP; lose the True 63A6F Is the list empty? If so, push a True 6191F If True, DROP2, do next, and end; else skip next 6577B "Undefined"; the entire key is undefined; say so & stop 03223 Internal SWAP --> { the key's 6 definitions } 056B6 Internal GET --> either the definition or { }, and True 03244 Internal DROP; lose the True 63A6F Is the list empty? If so, push a True 618F7 If True, DROP, do next, and end; else skip next 6577B "Undefined"; that key is undefined; say so & stop 0312B End program; exit with keycode floating above definition. ---- GETKEY in Wickes' ASC format ------------------------------- %%HP:; "D9D204B2A2837A1881302AC14F3F14592306B65044230F6A36F1916B77563223 06B65044230F6A367F816B7756B2130D94E" ----------------------------------------------------------------- Before ASC-> conversion: Size 105, CRC #144Ch. After ASC-> conversion: Size 47.5, CRC #E49Dh. Thanks to Rick Grevelle and Derek Nickel who made this possible. -- Joseph K. Horn -- Peripheral Vision, Ltd. --