readln |
Table of contents
ProcedureREADLN ( Read a text line from a logical unit ) SUBROUTINE READLN ( UNIT, LINE, EOF ) AbstractRead a single line of text from the Fortran logical unit UNIT, reporting the end of file if it occurs. Required_ReadingNone. KeywordsASCII FILES TEXT DeclarationsINTEGER UNIT CHARACTER*(*) LINE LOGICAL EOF Brief_I/OVARIABLE I/O DESCRIPTION -------- --- -------------------------------------------------- UNIT I The Fortran unit number to use for input. LINE O The line read from the file. EOF O A logical flag indicating the end of file. Detailed_InputUNIT is the Fortran unit number for the input. This may be either the unit number for the terminal, or the unit number of a previously opened text file. Detailed_OutputLINE is the next text line encountered when reading from UNIT. If the length of the character string LINE is shorter than the length of the current line in the text file, the line is truncated on the right by the Fortran READ statement, filling LINE with the first LEN(LINE) characters from the current line in the file. If an error or the end of file occurs during the attempt to read from UNIT, the value of this variable is not guaranteed. EOF is .TRUE. if the end of file ( IOSTAT < 0 ) is encountered during the attempt to read from unit UNIT. Otherwise, this variable will be set to .FALSE. ParametersNone. ExceptionsThis routine only checks in with the error handler in the event that an error occurred. (Discovery check in) 1) If an error occurs while attempting to read from the text file attached to UNIT, the error SPICE(FILEREADFAILED) is signaled. FilesNone. ParticularsThis routine will read a single line, a text record, from the logical unit UNIT. UNIT may be the terminal, or it may be a logical unit number obtained from a Fortran OPEN or INQUIRE statement. This routine will set a logical flag, EOF, on output if the end of the file is encountered during the read attempt. ExamplesCALL READLN ( UNIT, LINE, EOF ) IF ( EOF ) THEN < The end of file, deal with it appropriately > END IF You now have a line of text from unit UNIT. RestrictionsNone. Literature_ReferencesNone. Author_and_InstitutionJ. Diaz del Rio (ODC Space) K.R. Gehringer (JPL) VersionSPICELIB Version 1.1.0, 12-AUG-2021 (JDR) Added IMPLICIT NONE statement. Edited the header to comply with NAIF standard. Removed unnecessary $Version history entries for Beta versions. SPICELIB Version 1.0.0, 20-DEC-1995 (KRG) |
Fri Dec 31 18:36:41 2021