6.2.6 Q edit descriptor

Some Fortran compilers provide the Q edit descriptor, which transfers the number of characters left within an input record into an integer variable.

A direct replacement of the Q edit descriptor is not available in gfortran. How to replicate its functionality using standard-conforming code depends on what the intent of the original code is.

Options to replace Q may be to read the whole line into a character variable and then counting the number of non-blank characters left using LEN_TRIM. Another method may be to use formatted stream, read the data up to the position where the Q descriptor occurred, use INQUIRE to get the file position, count the characters up to the next NEW_LINE and then start reading from the position marked previously.

© Free Software Foundation
Licensed under the GNU Free Documentation License, Version 1.3.
https://gcc.gnu.org/onlinedocs/gcc-9.3.0/gfortran/Q-edit-descriptor.html