
October 26th, 2006, 09:06 PM
|
|
|
Quote: | Originally Posted by gaanee Is there any way in Fortran77 to concatenate an integer with a character data type?
Basically, I'm trying to create filenames in a loop like:
file01.out
file02.out
file03.out
....
.......
for this I need to concatenate 'file' which is a character with 01 which is an integer, and I cannot simply do file//01, since the data types are different.
Is there a way to get around this issue in Fortran77.
is there any function similar to sprintf in F77. |
the concatanation operator "//" deosn't work since one argument is integer, so I wrote a format statement and then write it to a file then read it from the file. seems to be some extra work in opening, writing and then reading it from a file, but it works. I've to write it and then read, since it seems that if u have a format statement, then the only place u can use it is a write statement.
does anyone know of a better way?
|