SYNOPSIS¶
- PROGRAM TEST1
INTEGER I1, I2 LOGICAL LSAME EXTERNAL LSAME INTRINSIC ICHAR I1 =
ICHAR( 'A' ) I2 = ICHAR( 'a' ) IF( I2-I1.EQ.32 ) THEN WRITE( *, * ) ' ASCII
character set' ELSE WRITE( *, * ) ' Non-ASCII character set, IOFF should be
',I2-I1 END IF IF( WRITE( *, 9999 )'A', 'A' IF( WRITE( *, 9999 )'A', 'a' IF(
WRITE( *, 9999 )'a', 'A' IF( WRITE( *, 9999 )'a', 'a' IF( LSAME( 'A', 'B' )
) WRITE( *, 9998 )'A', 'B' IF( LSAME( 'A', 'b' ) ) WRITE( *, 9998 )'A', 'b'
IF( LSAME( 'a', 'B' ) ) WRITE( *, 9998 )'a', 'B' IF( LSAME( 'a', 'b' ) )
WRITE( *, 9998 )'a', 'b' IF( LSAME( 'O', '/' ) ) WRITE( *, 9998 )'O', '/'
IF( LSAME( '/', 'O' ) ) WRITE( *, 9998 )'/', 'O' IF( LSAME( 'o', '/' ) )
WRITE( *, 9998 )'o', '/' IF( LSAME( '/', 'o' ) ) WRITE( *, 9998 )'/', 'o'
WRITE( *, * )' Tests completed' 9999 FORMAT( ' *** Error: LSAME( ', A1, ',
', A1, ') is .FALSE.' ) 9998 FORMAT( ' *** Error: LSAME( ', A1, ', ', A1, ')
is .TRUE.' ) END