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 

Another problem with the OPEN statement

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



Joined: 11 Apr 2005
Posts: 371

PostPosted: Tue Sep 04, 2007 4:32 pm    Post subject: Another problem with the OPEN statement Reply with quote

Quite coincidentally, I have been having fun of a different kind with the OPEN statement today. When I finally realised what I was doing wrong, it prompted the question whether or not I should reasonably expect the compiler to catch the error in question.

I had confused two specifiers in the OPEN statement. I had a statement that read (in part):

OPEN (....., status = 'append', ...)

rather than the intended:

OPEN (....., status = 'old', position = 'append', ...)

The outcome that every time the statement was executed, the existing file contents were wiped and replaced with the payload of the next WRITE statement - exactly the reverse of the intended outcome.

Metcalf & Reid says, apropos of all the various character-type specifiers, that they must provide one of a specific list of values. It is silent (as far as I can see) on what should happen if an unrecognised value is provided for a specifier. What appears to be happening is that the default value is used if the value supplied is not one of the permissible ones. What I incline to think should happen is that a run-time error message should be issued.

What do others think? What does the standard say?

Actually, now I come to write this down, it is ringing vague bells of a I've-asked-something-on-these-lines-this-before nature. Sorry if so.

Andy
Back to top
View user's profile Send private message Send e-mail
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