- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Does anyone know much about nonadvancing I/O? I am trying to read an input record without knowing how many values are on the line beforehand. It seems to me that this should work similar to an END= statement when reaching the end of a file.
However, when I implement a read statement with ADVANCE="NO" and using an implied DO loop where the ending loop counter is > the number of inputs for a record, no transfer occurs to a statement label when reaching the end of record. Additionally, all the values in the array from 1 to the ending value of the DO loop counter have taken on values. In other words, I am looping from 1 to 9, but there are only 3 values of 12 in the record. After executing the statement in the debugger, the array has 12 assigned to the first 9 values rather than just the first 3 and the error condition is never met. Here is the code:
The documentation is minimal at best in the help system and refers me to the programmer's guide for more information. Any help would be appreciated.
Tom
However, when I implement a read statement with ADVANCE="NO" and using an implied DO loop where the ending loop counter is > the number of inputs for a record, no transfer occurs to a statement label when reaching the end of record. Additionally, all the values in the array from 1 to the ending value of the DO loop counter have taken on values. In other words, I am looping from 1 to 9, but there are only 3 values of 12 in the record. After executing the statement in the debugger, the array has 12 assigned to the first 9 values rather than just the first 3 and the error condition is never met. Here is the code:
JS = 1 JE = 9 DO WHILE (.TRUE.) READ (CON,'(8X,9I8)',ADVANCE="NO",EOR=1) (NPPP(J),J=JS,JE JS = JS+9 JE = JE+9 END DO 1 CONTINUE
The documentation is minimal at best in the help system and refers me to the programmer's guide for more information. Any help would be appreciated.
Tom
Link Copied
4 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
What the blue blazes happened to my post? The subject line somehow took on what I wrote for my entire post.
Tom
Tom
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You used " and > in the text - this confuses the forum software. Try to remember to use " and > instead. I edited the post.
Steve
Steve
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I tried reproducing this with a program based on your code fragment, but couldn't. It seemed to work as you expect. How about posting a small but complete program and a sample data file. You may want to change the format so it doesn't need quite so much room.
Steve
Steve
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Steve,
Somehow my post for answering the problem didn't get posted. It was pilot error - I made changes to the input file but didn't save them before I ran the code. It works as advertised - sorry to have wasted your time.
Tom
Somehow my post for answering the problem didn't get posted. It was pilot error - I made changes to the input file but didn't save them before I ran the code. It works as advertised - sorry to have wasted your time.
Tom

Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page