C$Procedure UPCASE C SUBROUTINE UPCASE ( STR ) C C******************************************************************************* C C Copyright (C) 1993, California Institute of Technology. U.S. C Government Sponsorhip under NASA Contract NAS7-918 is C acknowledged. C C******************************************************************************* C C C$ Purpose C C UPCASE converts any lower case letters in a string to uppercase. C C$ Log C C 12-Aug-1987 C Eric Cannell - birth C C 01-Sep-1987 C Eric Cannell - SID C C$ Restrictions C C 1- Basically, STR can contain any ASCII character. C C$ Input_Arguments C C STR - string of arbitrary characters C C$ Output_Arguments C C STR - input string with lower case letter converted to uppercase C C$ Declarations_of_Input_and_Output_Arguments C CHARACTER*(*) STR C C$ Declarations_of_Local_Variables C INTEGER I INTEGER LSTR INTEGER OFFSET C C$ Data_Statements C DATA OFFSET / 32 / C C$ Method C-& C1 Compute length of string. LSTR = LEN(STR) C1 Check each character in the string. DO 10 I = 1 , LSTR C2 If it is a lowercase letter, then convert it to uppercase. IF ('a' .LE. STR(I:I) .AND. STR(I:I) .LE. 'z') THEN STR(I:I) = CHAR ( ICHAR ( STR(I:I) ) - OFFSET ) END IF C2 Otherwise, skip that character and continue. 10 CONTINUE RETURN END