Character in Real ?

34 views
Skip to first unread message

Lyk

unread,
Apr 5, 2014, 3:24:56 PM4/5/14
to gnu-f...@googlegroups.com
Hello,
 
I'm new in GNU Fortran.
 
I try to perform the following code (in Fortran 77) :
       PROGRAM TEST
C
       REAL*8 VAL
C
       VAL = 'Hello !!'
       WRITE (6,1000) VAL
 1000  FORMAT(' My message : ', A8)
C
       STOP
       END
With old compilers such Digital Visual Fortran, this program works perfectly.
 
But with gfortran, I can't compile. The error is :
Error: Can't convert CHARACTER(1) to REAL(8)
 
Is there a compiler option to solve it and to allow automatic conversion from CHARACTER to REAL ?
 
Thanks,
 
Lyk
 

Beliavsky

unread,
Apr 22, 2014, 5:14:59 PM4/22/14
to gnu-f...@googlegroups.com
I don't know of a compiler option to do what you request, and I wonder what real number you think 'Hello !!' should correspond to.
Reply all
Reply to author
Forward
0 new messages