- Marquer comme nouveau
- Marquer
- S'abonner
- Sourdine
- S'abonner au fil RSS
- Surligner
- Imprimer
- Signaler un contenu inapproprié
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.
- Balises:
- Intel® Fortran Compiler
1 Solution
- Marquer comme nouveau
- Marquer
- S'abonner
- Sourdine
- S'abonner au fil RSS
- Surligner
- Imprimer
- Signaler un contenu inapproprié
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.
Lien copié
4 Réponses
- Marquer comme nouveau
- Marquer
- S'abonner
- Sourdine
- S'abonner au fil RSS
- Surligner
- Imprimer
- Signaler un contenu inapproprié
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.
- Marquer comme nouveau
- Marquer
- S'abonner
- Sourdine
- S'abonner au fil RSS
- Surligner
- Imprimer
- Signaler un contenu inapproprié
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.
- Marquer comme nouveau
- Marquer
- S'abonner
- Sourdine
- S'abonner au fil RSS
- Surligner
- Imprimer
- Signaler un contenu inapproprié
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.
- Marquer comme nouveau
- Marquer
- S'abonner
- Sourdine
- S'abonner au fil RSS
- Surligner
- Imprimer
- Signaler un contenu inapproprié
This will be fixed in the next major release, due out late this year.

Répondre
Options du sujet
- S'abonner au fil RSS
- Marquer le sujet comme nouveau
- Marquer le sujet comme lu
- Placer ce Sujet en tête de liste pour l'utilisateur actuel
- Marquer
- S'abonner
- Page imprimable