- Marcar como novo
- Marcador
- Subscrever
- Silenciar
- Subscrever fonte RSS
- Destacar
- Imprimir
- Denunciar conteúdo inapropriado
I was just reading jm-nichols post on some "old code" and unformatted reads and noted a similar problem I was having with somewhat similar code:
REAL TIME CHARACTER (LEN = 8) NAME INTEGER IX, IY, IZ, IDX, ITYPE ! INPUT_CODE is an input parameter, the UNIT number READ(INPUT_CODE,*) NAME, TIME, IX, IY, IZ, IDX, ITYPE
I was getting a cold hard crash when the input stream had a forward slash in the name. Are the admissible characters you can read into a character string with an unformatted READ documented somewhere? Might this behavior have something to do with my compiler settings?
- Marcas:
- Intel® Fortran Compiler
Link copiado
- Marcar como novo
- Marcador
- Subscrever
- Silenciar
- Subscrever fonte RSS
- Destacar
- Imprimir
- Denunciar conteúdo inapropriado
List directed technically is formatted. List directed read into a character variable is notoriously unreliable, although quote marks may help.
- Marcar como novo
- Marcador
- Subscrever
- Silenciar
- Subscrever fonte RSS
- Destacar
- Imprimir
- Denunciar conteúdo inapropriado
First, some terminology. This is a list-directed formatted read, not unformatted. The Fortran standard indicates what is valid input for list-directed. though Intel Fortran is a bit more lenient. In the case you mention, read of an undelimited character value stops when a "value separator) is seen. The value separators are slash, comma and blank (or tab in our implementation). Slash causes input termination, so that is probably why your reads fail.
You can enclose the name string in quotes in the input to get around this, if the name has separators in it.
- Marcar como novo
- Marcador
- Subscrever
- Silenciar
- Subscrever fonte RSS
- Destacar
- Imprimir
- Denunciar conteúdo inapropriado
Thank you. Yes, unfortunately I misnamed the topic. What I was trying to point out was that there was not an explicit FMT given with the READ. Thank you for the list of "value separators" and the workaround. I will inform our UI team of the limitation. I suppose then one other limitation might be unmatched quote marks?
- Marcar como novo
- Marcador
- Subscrever
- Silenciar
- Subscrever fonte RSS
- Destacar
- Imprimir
- Denunciar conteúdo inapropriado
Unmatched quotes would be a problem, yes.

- 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