- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I recently converted from DVF to IVF and have had few problems, but here is one that has come up.
I'm reading a series of 8-byte strings from a text file, one string per line in the file. The list ends with an EOF mark (character 26). For example, consider the input file:
XXXXXXXX
[EOF]
In DVF the following code gives i=1, but in recompiling in IVF I get i=2 and ALIST(2) gets the EOF mark. Is there a compiler switch that will make IVF behave like DVF in this regard?
CHARACTER*8 ALIST(N) ! N is passed from calling routine
I=0
1 DO WHILE (I.LE.N-1)
READ (14,'(A8)',END=2,ERR=3) ALIST(I+1)
I=I+1
END DO
Thanks in advance.
I'm reading a series of 8-byte strings from a text file, one string per line in the file. The list ends with an EOF mark (character 26). For example, consider the input file:
XXXXXXXX
[EOF]
In DVF the following code gives i=1, but in recompiling in IVF I get i=2 and ALIST(2) gets the EOF mark. Is there a compiler switch that will make IVF behave like DVF in this regard?
CHARACTER*8 ALIST(N) ! N is passed from calling routine
I=0
1 DO WHILE (I.LE.N-1)
READ (14,'(A8)',END=2,ERR=3) ALIST(I+1)
I=I+1
END DO
Thanks in advance.
1 Solution
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Ok, I understand now. Yes, that's an ENDFILE record in there and I can see a difference from CVF. You can get the behavior you want by adding the /vms switch, though this should not, I think, be required. I'll let the developers know about this.
Link Copied
4 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I can think of at least two different things that may be at work here, but without a full test case I'm not sure what it might be. You also don't say which "DVF" you're using.
First, early versions of DVF did not properly handle data files where the last record didn't end in a newline. That was fixed at some point fairly early in the product. Second, and I don't remember when this change was made, an end-of-file condition is not supposed to trigger an ERR= branch, though since you also have END= that may not matter.
Can you show a small but complete program that illustrates the problem?
There is no compiler switch controlling this behavior.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Quoting - Steve Lionel (Intel)
Here is a small complete example (attached, and reproduced below), along with an example input file.
I was previously using DVF6.
Thanks.
I can think of at least two different things that may be at work here, but without a full test case I'm not sure what it might be. You also don't say which "DVF" you're using.
First, early versions of DVF did not properly handle data files where the last record didn't end in a newline. That was fixed at some point fairly early in the product. Second, and I don't remember when this change was made, an end-of-file condition is not supposed to trigger an ERR= branch, though since you also have END= that may not matter.
Can you show a small but complete program that illustrates the problem?
There is no compiler switch controlling this behavior.
I was previously using DVF6.
Thanks.
I can think of at least two different things that may be at work here, but without a full test case I'm not sure what it might be. You also don't say which "DVF" you're using.
First, early versions of DVF did not properly handle data files where the last record didn't end in a newline. That was fixed at some point fairly early in the product. Second, and I don't remember when this change was made, an end-of-file condition is not supposed to trigger an ERR= branch, though since you also have END= that may not matter.
Can you show a small but complete program that illustrates the problem?
There is no compiler switch controlling this behavior.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Ok, I understand now. Yes, that's an ENDFILE record in there and I can see a difference from CVF. You can get the behavior you want by adding the /vms switch, though this should not, I think, be required. I'll let the developers know about this.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
This will be fixed in the next major release, due out late this year.

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