C CHRMAIN.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 CHRMAIN character (len=20) :: line1, line2, line3 line1 = 'This is a message' line2 = 'zzzzzzzzzzzzzzzzzzzz' line3 = 'aaaaaaaaaaaaaaaaaaaa' call forcaps(line1,line2) print 20, line1 print 20, line2 20 format (1X,A) call asmcaps(line1,line3) print 20, line1 print 20, line3 stop end SUBROUTINE FORCAPS(L1,L2) character*(*) :: l1, l2 n = len(l1) ! Converts all do i=1,n ! chars to caps ic = ichar(l1(i:i)) if (ic.ge.97 .and. ic.le.122) ic = ic-32 l2(i:i) = char(ic) enddo return end