You can write to a string like this:
function magic ( i )
character (len = 10) :: magic
integer :: i
write( magic, '(i4)') i
End
Regards,
Mandeep Singh
COADE, Inc.
> -----Original Message-----
> From: A. G. P. [SMTP:[log in to unmask]]
> Sent: Saturday, August 28, 1999 12:08 AM
> To: [log in to unmask]
> Subject: Changing an Integer to a charcter???How????
>
> Im creating a FORTRAN90 program that loops through
> a series of numbers and then uses that number as a file
> reference. Problem is that i cant figure out how to change
> an integer to a string so i can concatenate a series of strings
> with it to create a bigger string.
> the pseudocode looks something like this:
>
> ***************************************
> integer i
> character*10 chari
> character*132 newline
>
> for i=1 to 100
> chari = magic(i) <----this is the function i need!!
> newline = 'Input file='//chari//'.vfp'
> write(6,*)newline
> next i
> ***************************************
> the ouput would look something like this:
> Input file=1.vfp
> Input file=2.vfp
> Input file=3.vfp
> .
> .
> Input file=30.vfp
> .
> .
> Input file=100.vfp
> ***************************************
> the function magic() is what im looking for to magically
> transform the integer number into a character string that
> i can concatenate to other strings. PLEASE HELP ME!!!
> ive tried many things but cant seem to figure it out.
> post to this group and email me directly please
>
> --
>
> [log in to unmask]
>
>
>
> ******************************************************
> "Unfortunately, no one can be told what
> the Matrix is. You have to see it for yourself."
> http://www2.crosswinds.net/~sindizzy/
> ******************************************************
>
> ________________________________________________________
> NetZero - We believe in a FREE Internet. Shouldn't you?
> Get your FREE Internet Access and Email at
> http://www.netzero.net/download/index.html
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|