Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
character(len=*), | intent(in) | :: | InputString |
Nodes of different colours represent the following:
Solid arrows point from a procedure to one which it calls. Dashed arrows point from an interface to procedures which implement that interface. This could include the module procedures in a generic interface or the implementation in a submodule of an interface in a parent module. Where possible, edges connecting nodes are given different colours to make them easier to distinguish in large graphs.
FUNCTION DOMakeUPPERCase(InputString) RESULT (ResultString)
! FUNCTION INFORMATION:
! AUTHOR Linda K. Lawrie
! DATE WRITTEN September 1997
! MODIFIED na
! RE-ENGINEERED na
! PURPOSE OF THIS SUBROUTINE:
! This function returns the Upper Case representation of the InputString.
! METHODOLOGY EMPLOYED:
! Uses the Intrinsic SCAN function to scan the lowercase representation of
! characters (DataStringGlobals) for each character in the given string.
! REFERENCES:
! na
! USE STATEMENTS:
! na
IMPLICIT NONE ! Enforce explicit typing of all variables in this routine
! FUNCTION ARGUMENT DEFINITIONS:
CHARACTER(len=*), INTENT(IN) :: InputString ! Input String
CHARACTER(len=len(InputString)) ResultString ! Result String, string is limited to
! MaxInputLineLength because of PowerStation Compiler
! otherwise could say (CHARACTER(len=LEN(InputString))
! FUNCTION PARAMETER DEFINITIONS:
! na
! INTERFACE BLOCK SPECIFICATIONS
! na
! DERIVED TYPE DEFINITIONS
! na
! FUNCTION LOCAL VARIABLE DECLARATIONS:
INTEGER i ! Loop Counter
INTEGER :: CurCharVal
ResultString=InputString
do i = 1, LEN_TRIM(InputString)
curCharVal = ICHAR(InputString(i:i))
SELECT CASE (curCharVal)
CASE (97:122,224:255) !lowercase ASCII and accented characters
ResultString(i:i) = CHAR(curCharVal-32)
CASE DEFAULT
END SELECT
end do
! ! first check for normal lowercase char, then normal uppercase char
! if(InputString(i:i) >= "a" .and. InputString(i:i) <= "z") then
! ResultString(i:i) = achar(iachar(InputString(i:i)) - 32)
! else if (InputString(i:i) >= "A" .and. InputString(i:i) <= "Z") then
! cycle !ResultString(i:i) = InputString(i:i) ! leave as is
! else ! now see if it's an accented char that needs uppercaseing
! Pos=SCAN(AccentedLowerCase,InputString(i:i))
! if (Pos /= 0) THEN
! ResultString(i:i)=AccentedUpperCase(Pos:Pos)
! ELSE
! cycle !ResultString(i:i) = InputString(i:i)
! ENDIF
! end if
! end do
! do i = 1, LEN_TRIM(InputString)
! ! first check for normal lowercase char, then normal uppercase char
! if(InputString(i:i) >= "a" .and. InputString(i:i) <= "z") then
! ResultString(i:i) = achar(iachar(InputString(i:i)) - 32)
! else if (InputString(i:i) >= "A" .and. InputString(i:i) <= "Z") then
! cycle !ResultString(i:i) = InputString(i:i) ! leave as is
! else ! now see if it's an accented char that needs uppercaseing
! Pos=SCAN(AccentedLowerCase,InputString(i:i))
! if (Pos /= 0) THEN
! ResultString(i:i)=AccentedUpperCase(Pos:Pos)
! ELSE
! cycle !ResultString(i:i) = InputString(i:i)
! ENDIF
! end if
! end do
!
! ResultString=TRIM(ResultString)
! ResultString=Blank
! Pos=SCAN(InputString,LowerCase)
! IF (POS /= 0) THEN
! LengthInputString=LEN_TRIM(InputString)
! DO Count=1,LengthInputString
! Pos=SCAN(LowerCase,InputString(Count:Count))
! IF (Pos /= 0) THEN
! ResultString(Count:Count)=UpperCase(Pos:Pos)
! ELSE
! ResultString(Count:Count)=InputString(Count:Count)
! ENDIF
! END DO
! ResultString=TRIM(ResultString)
! ELSE
! ! String already in Upper Case
! ResultString=TRIM(InputString)
! ENDIF
RETURN
END FUNCTION DOMakeUPPERCase