replica nfl jerseysreplica nfl jerseyssoccer jerseyreplica nfl jerseys forums.silverfrost.com :: View topic - CONTAINS apparently not recognised
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 

CONTAINS apparently not recognised

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



Joined: 28 Sep 2024
Posts: 2

PostPosted: Sat Sep 28, 2024 5:47 pm    Post subject: CONTAINS apparently not recognised Reply with quote

I am trying to write a very simple program in the Plato IDE. However, despite the second Module having a CONTAINS statement, it refuses to compile because it has an executable line it it. Any suggestions?

Here is the code:

MODULE mDialog1
IMPLICIT NONE
PRIVATE; PUBLIC
INTEGER :: easting, northing, nrp, roofs, rb1
DOUBLE PRECISION :: roof_area, pitch
CHARACTER(len=256) :: buffer
INTEGER :: iw
END MODULE mDialog1

MODULE mDialog2
USE mDialog1
CONTAINS
IMPLICIT NONE
easting =456654
END MODULE mDialog2`
This generates the following message:

C:\Users\Robin\Documents\Testclearwin\FreeFormat1.F95(14) : error 853 - Executable statements are not allowed inside a MODULE (unless in CONTAINS)

I have tried changing the position of the CONTAINS statement and using fixed and free format. I was expecting it to compile properly.
Back to top
View user's profile Send private message
Kenneth_Smith



Joined: 18 May 2012
Posts: 730
Location: Hamilton, Lanarkshire, Scotland.

PostPosted: Sat Sep 28, 2024 7:46 pm    Post subject: Reply with quote

An assignment such as easting =456654, must be within a subroutine or function that is within the contains section of the module.

Also IMPLICIT NONE must come immediately after any USE statements, and not be within the contains section.

You also need to specifically name the variables you wish to have the PUBLIC attribute. As it stands everything in the module mDialog1 is hidden.
Back to top
View user's profile Send private message Visit poster's website
hydro_rlh



Joined: 28 Sep 2024
Posts: 2

PostPosted: Sun Sep 29, 2024 7:54 am    Post subject: CONTAINS apparently not recognised Reply with quote

Many thanks Kenneth_Smith for your help. As you probably realise this is the first time that I have tried to use MODULES and associated statements.
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