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 

illegal character assignment

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



Joined: 20 Feb 2007
Posts: 10

PostPosted: Wed Mar 14, 2007 12:55 pm    Post subject: illegal character assignment Reply with quote

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


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

PostPosted: Wed Mar 14, 2007 1:37 pm    Post subject: Reply with quote

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
View user's profile Send private message AIM Address
john62



Joined: 20 Feb 2007
Posts: 10

PostPosted: Wed Mar 28, 2007 1:53 pm    Post subject: Reply with quote

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
View user's profile Send private message
john62



Joined: 20 Feb 2007
Posts: 10

PostPosted: Wed Mar 28, 2007 4:27 pm    Post subject: Reply with quote

Sorry paul
I found the mistake I make all ready
greating john
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 -> Support 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