forums.silverfrost.com Forum Index forums.silverfrost.com
Welcome to the Silverfrost forums
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Converting Integer to Character

 
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> General
View previous topic :: View next topic  
Author Message
Fortran77



Joined: 19 Dec 2007
Posts: 19

PostPosted: Thu Apr 03, 2008 10:55 pm    Post subject: Converting Integer to Character Reply with quote

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 Confused
Back to top
View user's profile Send private message
PaulLaidler
Site Admin


Joined: 21 Feb 2005
Posts: 7926
Location: Salford, UK

PostPosted: Fri Apr 04, 2008 9:12 am    Post subject: Reply with quote

write(word,"(i4)") number
Back to top
View user's profile Send private message AIM Address
Fortran77



Joined: 19 Dec 2007
Posts: 19

PostPosted: Sat Apr 05, 2008 12:48 am    Post subject: Reply with quote

Thanks Paul

Smile Very Happy
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> General All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group