home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.rexx
- Path: sparky!uunet!mcsun!sunic!fuw.edu.pl!cocos!jt
- From: jt@fuw.edu.pl (Jerzy Tarasiuk)
- Subject: Re: Lower-case alphabetic set
- In-Reply-To: MCMASTER@LSTC2VM.stortek.com's message of Wed, 6 Jan 1993 16:03:11 GMT
- Message-ID: <JT.93Jan21143931@fizyk1.fuw.edu.pl>
- Sender: news@fuw.edu.pl
- Nntp-Posting-Host: fizyk1
- Organization: Warsaw University Physics Dept.
- References: <1993Jan5.064658.4491@schbbs.mot.com> <16B4E7F50.MCMASTER@LSTC2VM.stortek.com>
- Date: Thu, 21 Jan 1993 13:39:31 GMT
- Lines: 24
-
- >>>>> On Wed, 6 Jan 1993 16:03:11 GMT, MCMASTER@LSTC2VM.stortek.com (Jim McMaster) said:
- Jim> Nntp-Posting-Host: lstc2vm.stortek.com
- Jim> In article <1993Jan5.064658.4491@schbbs.mot.com>
- Jim> TCSAR03@waccvm.corp.mot.com (Germain Leutwyler) writes:
- >Here is another routine to translate each letter from uppercase to
- >lowercase. You may specify the characters that shouldn'tbe converted
- >in the verify function.
- >/* TRANSLATION OF CERTAIN CHARACTERS WITHIN STRING "ST" TO LOWERCASE */
- >ST=''
- >do P=1 to length(ST)
- > C=substr(ST,P,1)
- > if verify(C,'?!0123456789')/=0 then C=bitxor(C,' ')
- > ST=ST||C
- >end
-
- It would be better to use verify to check if character belongs to
- uppercase alpha:
- if verify(C,'ABCDEFGHIJKLMNOPQRSTUVWXYZ')=0 then C=bitxor(C,' ')
-
- Jim> This works, but only for EBCDIC, and is much slower than the built-in
- Jim> translate function.
-
- This works for ASCII, too. ASCII 'A'=0x41,'a'=0x61,' '=0x20
- EBCDIC 'A'=0xC1,'a'=0x81,' '=0x40
-