View previous topic :: View next topic |
Author |
Message |
john62
Joined: 20 Feb 2007 Posts: 10
|
Posted: Wed Mar 14, 2007 12:55 pm Post subject: illegal character assignment |
|
|
I am trying to take an old fortran code and re-compile it.
But get this message from the compiler
by " string(1:ns)=string(k1:k2) "
how can I overcome this problem?
Thanks john |
|
Back to top |
|
|
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 7928 Location: Salford, UK
|
Posted: Wed Mar 14, 2007 1:37 pm Post subject: |
|
|
Chances are you need to copy to a temporary string first.
tmp=string(k1:k2)
string(1:ns)=tmp
I think this is required by the Fortran Standard.
The reason would be the potential overlap when k1 and/or k2 are in the range 1:ns. |
|
Back to top |
|
|
john62
Joined: 20 Feb 2007 Posts: 10
|
Posted: Wed Mar 28, 2007 1:53 pm Post subject: |
|
|
Hallo Paul
I changed to the code you suggested
But get a error now
Error C:\............. (105) "=" has incompatible operands
What can I do now ?. I am a new on fortran |
|
Back to top |
|
|
john62
Joined: 20 Feb 2007 Posts: 10
|
Posted: Wed Mar 28, 2007 4:27 pm Post subject: |
|
|
Sorry paul
I found the mistake I make all ready
greating john |
|
Back to top |
|
|
|