Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!sdd.hp.com!hp-pcd!hpcvra.cv.hp.com!rnews!hpcvbbs!akcs.scotty From: akcs.scotty@hpcvbbs.UUCP (SCOTTY THOMPSON) Newsgroups: comp.sys.handhelds Subject: Misc. m/l string functs. hp48 Keywords: string, m/l Message-ID: <284813da:3337comp.sys.handhelds@hpcvbbs.UUCP> Date: 1 Jun 91 21:40:06 GMT Lines: 80 My first attempts at m/l programming (something simple, yet sweet) were very successful. Thanks to all who have submitted information to the board! The following code, in ASC-> format are simple string functions for Lower-case, Upper-case, UpperFirst (which upper-cases the first character after any punctuation and lower-cases the rest). Also included here are two additional routines. One converts a string of less than 256 characters to a global name, and the other converts a global name to a string. LC$ -------------------- %%HP: T(1)A(D)F(.); "D9D20D29512BF81D0040D9D20CCD20A50008FB976020143130164142818F8542 3D816414A31149E25131A59E6C03102A6A148161818F9157D8D34150B2130B21 3038F1" {Converts string in level 1 to lower-case} UC$ --------------------- %%HP: T(1)A(D)F(.); "D9D20D29512BF81D0040D9D20CCD20A50008FB976020143130164142818F8542 3D816414A31169E25131A79E6C03102B6A148161818F9157D8D34150B2130B21 30DBDF" {Converts string in level 1 to upper-case} UFIRST$ ---------------------- %%HP: T(1)A(D)F(.); "D9D20D29512BF81D0040D9D20CCD20890008FB976020143130164142818F8540 7D816485014A31149E2D431B59E2A231A79E6B331169E223860038403102B6A1 4860208609084064103102A6A1486600850161818F915C98D34150B2130B2130 4ED0" {Converts string in level 1 to mixed-upper/lower case, depending whether or not the alpha character follows a non-alpha character (A-Z or a-z). For example, "P. O. BOX 123A-C, REDONDO BEACH, CA..." Would end-up as: "P. O. Box 123A-C, Redondo Beach, Ca..." STR->GN ------------------------ %%HP: T(1)A(D)F(.); "D9D20D29512BF81D0040D9D20C2A2050000756602C230636508813082E4676D3 6D9D20852302AC81B2130D9D20F6E30AA526C1C16CCD20F60008FB9760201438 18F09130141174143131174143818F84174819F03484E20144164148161AE8A6 D44114B148171161A6D50F8D34150B9F06B2130B2130B2130778F" {Converts string in level 1 to global name}. This is useful for many things, I've since found-out. For example, putting " " on the stack and executing STR-GN will leave a global variable on the stack as ' '. This cannot be entered from the keyboard, so anything stored in this variable won't get purged, etc. Try it! I've come-up with some very interesting tidbits this way. Another example: Create a directory called ' '. It will show-up as a blank var key with the directory bar above it. Press this key to go to this directory. Now type "" STR->GN CRDIR. You now have a 'hidden' subdirectory. To go to this "upper" subdirectory, type "" STR-GN EVAL. Did you notice the path at the top of the display? Turns-out that going to this null directory dosen't show the extra space in the path listing (the parent directory to this one). Currently, I'm nested 3 levels deep, plus the "space" directory. Try to purge this directory from the keyboard! It appears exactly like a "HOME" directory, so I've been putting my programs and such here that are miscellaneous and keeping the important "stuff" in my real HOME directory. Anyone I let use my calculator now will be logged-on to a virtually indestructible directory. GN->STR ---------------------- %%HP: T(1)A(D)F(.); "D9D20D29512BF81B2040D9D209EB50B2130B21304E11" {Converts global name in level 1 to a string object}. The code is much shorter because there is an internal routine that does this conversion. This is just the opposite of STR->GN. Happy computing. Oh, p.s., I'm not responsible. These routines work fine on my REV-E machine, but ya'll know the caveates.