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 

retired NEWBIE trying to use OPEN in FTN

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



Joined: 13 May 2008
Posts: 14

PostPosted: Wed May 14, 2008 12:39 am    Post subject: retired NEWBIE trying to use OPEN in FTN Reply with quote

These 2 OPEN statements
OPEN(unit=9,FILE='dale.txt',STATUS='NEW')
OPEN(unit=8,FILE='mm.txt',STATUS='READONLY')

dale.txt gets created at C:\Plato
I get this error
Runtime error from program:c:\plato\checkmate\win32\test2.exe
Run-time Error
*** Error 128, File does not exist

READFILE - in file test2.for at line 14 [+00f2]

main - in file test2.for at line 4 [+0039]

file mm.txt does exist at c:\Plato
any ideas what I am doing wrong?
Back to top
View user's profile Send private message
JohnCampbell



Joined: 16 Feb 2006
Posts: 2554
Location: Sydney

PostPosted: Wed May 14, 2008 1:40 am    Post subject: Reply with quote

Two ideas,

1) compile with /debug to get the line number.
2) use iostat=iostat in open statements to control the error response.

OPEN(unit=9,FILE='dale.txt',STATUS='NEW',IOSTAT=iostat)
if (iostat /= 0) then
CALL FORTRAN_ERROR_MESSAGE@(iostat, MESSAGE)
write (*,*) iostat, message
end if
...

You may be having problems with STATUS=...
STATUS='UNKNOWN' is much more friendly.
Back to top
View user's profile Send private message
WDG



Joined: 13 May 2008
Posts: 14

PostPosted: Wed May 14, 2008 11:14 am    Post subject: Thanks John Reply with quote

Very Happy Very Happy
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