home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 5 / 05.iso / a / a067 / 1.img / GRUMP501.EXE / WUPPER.PRG < prev    next >
Encoding:
Text File  |  1991-04-15  |  1.1 KB  |  35 lines

  1. /*
  2.    Function: WORLDUPPER()
  3.    Author:   Greg Lief
  4.    Copyright (c) 1990 Greg Lief
  5.    Dialect:  Clipper 5.0
  6.    Purpose:  converts a character string to upper-case, and handles
  7.              seven special extended ASCII characters
  8.    Syntax:   WorldUpper(<string to convert>)
  9.    Returns:  Character string converted to uppercase
  10.    Modified: 04/15/91 -- added support for 'φΘ' and 'æÆ'
  11.              special characters (thanks to Morten Ross)
  12. */
  13. function worldupper(mstring)
  14. local x, mchr, ele, ret_val := [], codes_ := { { 129, 154 } , { 130, 144 } , ;
  15.       { 132, 142 }, { 134, 143 }, { 135, 128 }, { 145, 146 }, { 148, 153 },  ;
  16.       { 164, 165 }, { 237, 233 } }
  17. for x = 1 to len(mstring)
  18.    mchr := asc(substr(mstring, x, 1))
  19.    do case
  20.       *** lower-case letter key
  21.       case mchr > 96 .and. mchr < 123
  22.          ret_val += chr(mchr - 32)
  23.  
  24.       case (ele := ascan(codes_, { | x | x[1] == mchr} ) ) > 0
  25.          ret_val += chr(codes_[ele, 2])
  26.  
  27.       otherwise
  28.          ret_val += chr(mchr)
  29.  
  30.    endcase
  31. next
  32. return ret_val
  33.  
  34. * eof: wupper.prg
  35.