home *** CD-ROM | disk | FTP | other *** search
/ Power-Programmierung / CD1.mdf / basic / library / qb_pds / bassub / toupper.fn < prev   
Encoding:
Text File  |  1987-10-18  |  571 b   |  24 lines

  1.  
  2. '---- ToUpper.Fn
  3. '   The Upper$ function converts alphabetic characters in a string
  4. '   value to uppercase letters.
  5.  
  6.     DEF FN ToUpper$(TextVal$)
  7.  
  8.         STATIC I%, Number$, Character$
  9.  
  10. '   Find the length of the string value recieved.
  11.         Number% = LEN(TextVal$)
  12.  
  13. '   Examine each character in the string, and convert as necessary.
  14.         FOR I% = 1 to Number%
  15.             Character$ = MID$(TextVal$, I%, 1)
  16.             IF (Character$ >= "a" AND Character$ <= "z") THEN
  17.                 MID$(TextVal$, I%) = CHR$(ASC(Character$) - 32)
  18.             END IF
  19.         NEXT I%
  20.         FN ToUpper$ = TextVal$
  21.  
  22.     END DEF
  23.  
  24.