Post Reply 
ToUpper() ?
03-10-2015, 07:51 AM
Post: #8
RE: ToUpper() ?
(03-09-2015 06:41 PM)Thomas_Sch Wrote:  
Code:
CHAR(ASC("abcdefg")-32)
results in "ABCDEFG".

(03-10-2015 06:27 AM)Angus Wrote:  
Code:
//convert 'a'..'z' to 'A'..'Z'. Leave others unchanged
EXPORT TOUPPER(s)
BEGIN
  LOCAL off, ch;

  IF TYPE(s)==2 THEN
    FOR off FROM 1 TO SIZE(s) DO
      ch:=s(off);
      IF ch>=97 AND ch<=122 THEN
         ch:=ch-32;
      END;
      s(off):=ch;
    END;
  END;
END

Combining the two above:
Code:
//convert 'a'..'z' to 'A'..'Z'. Leave others unchanged
EXPORT TOUPPER(s)
BEGIN
  IFTE(TYPE(s)==2, CHAR(EXECON("IFTE(&1>=97 AND &1<=122,&1-32,&1)",ASC(s))),s);
END;
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
ToUpper() ? - Angus - 03-09-2015, 01:02 PM
RE: ToUpper() ? - Thomas_Sch - 03-09-2015, 06:41 PM
RE: ToUpper() ? - PANAMATIK - 03-09-2015, 07:50 PM
RE: ToUpper() ? - Mark Hardman - 03-09-2015, 08:25 PM
RE: ToUpper() ? - jebem - 03-09-2015, 08:45 PM
RE: ToUpper() ? - Angus - 03-10-2015, 06:27 AM
RE: ToUpper() ? - cyrille de brébisson - 03-10-2015, 06:28 AM
RE: ToUpper() ? - Claudio L. - 03-12-2015, 04:19 PM
RE: ToUpper() ? - Didier Lachieze - 03-10-2015 07:51 AM
RE: ToUpper() ? - Thomas_Sch - 03-10-2015, 08:10 AM
RE: ToUpper() ? - Angus - 03-10-2015, 08:10 AM
RE: ToUpper() ? - Didier Lachieze - 03-10-2015, 08:34 AM
RE: ToUpper() ? - Angus - 03-10-2015, 08:26 AM
RE: ToUpper() ? - Angus - 03-10-2015, 09:16 AM
RE: ToUpper() ? - Didier Lachieze - 03-10-2015, 12:12 PM
RE: ToUpper() ? - Tim Wessman - 03-10-2015, 12:55 PM
RE: ToUpper() ? - BruceH - 03-11-2015, 11:44 PM
RE: ToUpper() ? - bobkrohn - 03-12-2015, 06:25 AM
RE: ToUpper() ? - cyrille de brébisson - 03-12-2015, 03:49 PM
RE: ToUpper() ? - bobkrohn - 03-12-2015, 04:44 PM
RE: ToUpper() ? - Didier Lachieze - 03-12-2015, 04:53 PM
RE: ToUpper() ? - bobkrohn - 03-12-2015, 08:05 PM
RE: ToUpper() ? - DrD - 03-12-2015, 08:44 PM
RE: ToUpper() ? - cyrille de brébisson - 03-13-2015, 06:18 AM
RE: ToUpper() ? - bobkrohn - 03-13-2015, 11:28 PM
RE: ToUpper() ? - DrD - 03-14-2015, 04:45 AM
RE: ToUpper() ? - cyrille de brébisson - 03-17-2015, 07:11 AM



User(s) browsing this thread: 2 Guest(s)