soccer jersey forums.silverfrost.com :: View topic - non-writable expression
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 

non-writable expression

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



Joined: 24 Oct 2016
Posts: 47
Location: Oxford,UK and Athens, Greece

PostPosted: Wed Dec 13, 2023 9:10 am    Post subject: non-writable expression Reply with quote

I have a problem with the following:

0095) READ(5,500) II, JJ, (VIEW(I, J, K),K=1,4)
*** Non-writable expression in READ statement
*** Compilation abandoned

I can find no reference to explain the problem here. The odd thing is that this error has only now appeared having been no problem before. I wondered if I had amended a compiler option somehow but again could find nothing to explain what was happening and why and so found no help to resolve the code.

What is happening here? Any suggestions?
_________________
Alan
Back to top
View user's profile Send private message
PaulLaidler
Site Admin


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

PostPosted: Wed Dec 13, 2023 10:18 am    Post subject: Reply with quote

This error report is produced by FTN95 when there is something wrong with one of the variables in the list.

How are II, JJ, and VIEW defined?
Back to top
View user's profile Send private message AIM Address
alangr



Joined: 24 Oct 2016
Posts: 47
Location: Oxford,UK and Athens, Greece

PostPosted: Wed Dec 13, 2023 10:33 am    Post subject: Reply with quote

The definitions are as below

INTEGER IOS, I, J, II, JJ

CHARACTER VIEW(20, 20, 4)*40

The latter is in a common block and the integers are local variables.

Thanks for your comments; does the above help?
_________________
Alan
Back to top
View user's profile Send private message
PaulLaidler
Site Admin


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

PostPosted: Wed Dec 13, 2023 11:20 am    Post subject: Reply with quote

Can you post a small program with all the necessary features to reproduce the error?
Back to top
View user's profile Send private message AIM Address
alangr



Joined: 24 Oct 2016
Posts: 47
Location: Oxford,UK and Athens, Greece

PostPosted: Wed Dec 13, 2023 11:53 am    Post subject: Reply with quote

The first line of code in my initial post delivered the two lines of comment that followed.

I have even tried the following 'program' with no declarations at all

READ(5,500) (VIEW(I, J, K),K=1,4)
*
END

and get the same results.

I am using code which appeared to be compiled OK yesterday morning that suddenly flagged this error and would not compile (I have other similar cases). Could I have inadvertently changed something in the settings....?

Thank you for your help - I am at a loss to understand the error.
_________________
Alan
Back to top
View user's profile Send private message
PaulLaidler
Site Admin


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

PostPosted: Wed Dec 13, 2023 12:08 pm    Post subject: Reply with quote

Yes but the compiler does not know that VIEW is an array.
Back to top
View user's profile Send private message AIM Address
mecej4



Joined: 31 Oct 2006
Posts: 1896

PostPosted: Wed Dec 13, 2023 12:18 pm    Post subject: Reply with quote

My guess is that the character array VIEW, which is in a common block, is used in more than one subprogram, and one of those subprograms does not contain the COMMON declaration. Absent a type declaration for VIEW, the expression VIEW(I,J,K) would be regarded as a function invocation with arguments I, J, K.
Back to top
View user's profile Send private message
alangr



Joined: 24 Oct 2016
Posts: 47
Location: Oxford,UK and Athens, Greece

PostPosted: Wed Dec 13, 2023 1:11 pm    Post subject: Reply with quote

That's it.

In editing files yesterday I inadvertently removed the include file that held all the declarations and common statements - and, more importantly, the 'implicit none'. So compilation seemed OK.....

Thank you Paul for tour help and thank you mecej4 for the help with the common block.

I am most grateful for your help.
_________________
Alan
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