C CHMAIN.FOR Copyright(c) 1998, Lahey Computer Systems, Inc. C Copying for sale requires permission from Lahey Computers Systems. C Otherwise, distribution of all or part of this file is permitted C if these four lines are included. PROGRAM M character*20 a, b, c, ffun, afun a = 'Hello' b = ffun(a) c = afun(b) print 20, a, b, c 20 format (' a = ',A/' b = ',A/' c = ',A) stop end CHARACTER*20 FUNCTION FFUN(A) character*(*) a n = len(a) do i=1,n ic = ichar(a(i:i)) if (ic.ge.97 .and. ic.le.122) ic = ic-32 ffun(i:i) = char(ic) enddo return end