|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Be the architects of evolution and help create the mobile internet future. It’s your move---enter to win here! |
|
#1
|
|||
|
|||
|
Concatenate integer with a character data type
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. |
|
#2
|
||||
|
||||
|
Please start your own thread.
__________________
Web Design Tips - Posting and You If I've been helpful, and/or you're really nice, consider buying something from my Amazon.com wishlist.
|
|
#3
|
|||
|
|||
|
There is already a thread with this question ... and there is already an answer
![]() |
|
#4
|
||||
|
||||
|
At least with F90 you can use write and fmt. I believe it was something like:
WRITE (chars,’(’ // .fmt. n // ’)’) n (n is integer) EDIT: Oh, sorry. I guess I was just a bit too enthusiastic to reply cause I once in my life knew the (partial) answer to something :/ Dang. Perhaps I someday will be the fastest ![]() |
|
#5
|
|||
|
|||
|
Quote:
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? |
|
#6
|
|||
|
|||
|
Quote:
Hello? Did you read my answer in your other post? |
![]() |
| Viewing: Dev Shed Forums > Programming Languages - More > Other Programming Languages > [Fortran77] concatenate an integer with a character data type |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|