View previous topic :: View next topic |
Author |
Message |
Fortran77
Joined: 19 Dec 2007 Posts: 19
|
Posted: Thu Apr 03, 2008 10:55 pm Post subject: Converting Integer to Character |
|
|
I'm trying to convert String variables into Integer variables and vice-versa.
Till now I can convert String into Integer but not the reverse.
Code: | Program Conversion
Integer Number
Character WORD*4
WORD = '1234'
READ(WORD, '(I4)') Number
Print *, 'The number is=', Number
! now, the reverse ... doesn't function
???READ(Number, '(I4)') WORD ???
END
|
A small solution I presume but I'm tired of looking for and trying and trying
Thanks |
|
Back to top |
|
|
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 7926 Location: Salford, UK
|
Posted: Fri Apr 04, 2008 9:12 am Post subject: |
|
|
write(word,"(i4)") number |
|
Back to top |
|
|
Fortran77
Joined: 19 Dec 2007 Posts: 19
|
Posted: Sat Apr 05, 2008 12:48 am Post subject: |
|
|
Thanks Paul
|
|
Back to top |
|
|
|