Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!usc!cs.utexas.edu!uunet!munnari.oz.au!brolga!uqcspe!cs.uq.oz.au!grue From: grue@cs.uq.oz.au (Frobozz) Newsgroups: comp.sys.handhelds Subject: Converting a string to uppercase. Keywords: strup Message-ID: <1009@uqcspe.cs.uq.oz.au> Date: 26 Apr 91 06:29:42 GMT Sender: news@cs.uq.oz.au Reply-To: grue@cs.uq.oz.au Organization: Computer Science Department, The University of Queensland, Brisbane, Australia Lines: 58 hiya, Somebody recently posted a user level RPL program that attempted to convert from lower case to upper case. Jan Brittenson pointed out that this program didn't work as advertised for some of the special characters. Well, what I've done is to write a machine code program. This program has been written to run quickly (as opposed to being short, but at 85 bytes I don't think anybody will mind all that much...the slower version would be a few bytes shorter :-) it can handle a 4000 character string, changing every character from lower case to upper case in less than 1 second; it would be even faster on strings that had capitals in them already. This routine does check that it is passed a string (sorry, the error message isn't quite up to scratch, it is hard to get it right --- Rick Grevelle sent a message recently that kind of discussed this, well really it talked a lot more about other issues and just said that this was hard ;-) and it works correctly for any length string (it is very very fast for zero length ones ;-) If anybody finds a bug in this, please tell me. I haven't found one and I've tried every character possible, but you never know for sure. I grant unlimited non-profit usage of this little routine to anybody who cares to use it (given how simple the algorithm is it wouldn't be difficult to regenerate the program) Is there any call for a string to lower case routine as well? It would be a very simple modification to this piece of code. This following string should be in ASC format. I added the checksum by hand and I also added the line breaks by hand so this may not work as desired. "D9D20ECE81D0040D9D2075660CCD20380008FB9760147134164146819F2CECE8 AAE4D71643106AE514A9EC0331B79EAD131FD9EAE1317F9625131FF962C0310E A6A148161CF8AF2C8F2D760142164808CB2130B2130BDE1" This is the string that I typed into my calculator (minus the newlines). I am quite confident that this really does work correctly. This string does not have the checksum present and it isn't broken into new lines as desired. D9D20ECE81D0040D9D2075660CCD20380008FB9760147134164146819F2CECE8AAE4D71643106 AE514A9EC0331B79EAD131FD9EAE1317F9625131FF962C0310EA6A148161CF8AF2C8F2D760142 164808CB2130B2130 Pauli seeya Paul Dale | Internet/CSnet: grue@cs.uq.oz.au Dept of Computer Science| Bitnet: grue%cs.uq.oz.au@uunet.uu.net Uni of Qld | JANET: grue%cs.uq.oz.au@uk.ac.ukc Australia, 4072 | EAN: grue@cs.uq.oz | UUCP: uunet!munnari!cs.uq.oz!grue f4e6g4Qh4++ | JUNET: grue@cs.uq.oz.au --