- Marcar como novo
- Marcador
- Subscrever
- Silenciar
- Subscrever fonte RSS
- Destacar
- Imprimir
- Denunciar conteúdo inapropriado
Hello, I have a question as follows.
I got an error message from my program.
fortl:severe(24): end-of-file during read, unit1, file cpppfile-name.log
Image PC...
DFORRTD.DLL
My program sorce ocde.
open(1,file=cpppfile-name.log)
read(1,'(i3)',err=11)tmpst
close(1)
11 goto 50
...
50 return
file-name.log size is 0 byte. Therefore I quess read statement would faild.
How should I fix this error? Please give me hands, please.
- Marcas:
- Intel® Fortran Compiler
Link copiado
5 Respostas
- Marcar como novo
- Marcador
- Subscrever
- Silenciar
- Subscrever fonte RSS
- Destacar
- Imprimir
- Denunciar conteúdo inapropriado
Just try a do while loop... And treat the filename as a string!
open(unit=1,file='cpppfile-name.log')
do while (.not. EOF(1))
read (1,'(i3)') tmpst
end do
close(1)
HTH, Markus
- Marcar como novo
- Marcador
- Subscrever
- Silenciar
- Subscrever fonte RSS
- Destacar
- Imprimir
- Denunciar conteúdo inapropriado
Is your path correct - i.e do you have a folder called c containing a subfolder called ppp at the level you are running the program from - or did you mean c:
- Marcar como novo
- Marcador
- Subscrever
- Silenciar
- Subscrever fonte RSS
- Destacar
- Imprimir
- Denunciar conteúdo inapropriado
ERR= label is not triggered when an end-of-file is reached; that's as it should be – you need an END= label instead. If you want to treat both EOF and other errors in the same way, you can specify both, or use IOSTAT=.
- Marcar como novo
- Marcador
- Subscrever
- Silenciar
- Subscrever fonte RSS
- Destacar
- Imprimir
- Denunciar conteúdo inapropriado
Hello,
This code should force any read error to jump to line 1100.
read (ZMESG,*, err=1100, IOSTAT=IERR) XX, YY
if (IERR .NE. 0) goto 1100
Hope this works,
Lars Petter
Message Edited by lpe@scandpowerpt.com on 03-24-200607:40 AM
- Marcar como novo
- Marcador
- Subscrever
- Silenciar
- Subscrever fonte RSS
- Destacar
- Imprimir
- Denunciar conteúdo inapropriado
Hello, I appreciate all of answering my issue.
I want to say thank you very much for suggestions.
All suggestions give me oppotunity to get important experiments.
Thank you again.

Responder
Opções do tópico
- Subscrever fonte RSS
- Marcar tópico como novo
- Marcar tópico como lido
- Flutuar este Tópico para o utilizador atual
- Marcador
- Subscrever
- Página amigável para impressora