Skip to content

Instantly share code, notes, and snippets.

@ComingNine
Created July 6, 2012 20:12
Show Gist options
  • Save ComingNine/347d4f5e3d1ce8eff5a4 to your computer and use it in GitHub Desktop.
Save ComingNine/347d4f5e3d1ce8eff5a4 to your computer and use it in GitHub Desktop.
Fortran version of Delphi's SysUtils.f90
!***|****1****|****2****|****3****|****4****|****5****|****6****|****7**
MODULE SysUtils
IMPLICIT NONE
CONTAINS
!***|****1****|****2****|****3****|****4****|****5****|****6****|****7**
FUNCTION UpperCase (String)
USE System
IMPLICIT NONE
CHARACTER(LEN=:), ALLOCATABLE :: UpperCase
CHARACTER(LEN=*), INTENT(IN) :: String
INTEGER(KIND=I8) :: I
INTEGER(KIND=I8) :: L
L = LEN(String)
UpperCase = String
DO I = 1, L
SELECT CASE (UpperCase(I:I))
CASE ('a':'z')
UpperCase(I:I) = ACHAR(IACHAR(UpperCase(I:I)) - 32)
END SELECT
END DO
END FUNCTION UpperCase
END MODULE SysUtils
!***|****1****|****2****|****3****|****4****|****5****|****6****|****7**
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment