chckid |
Table of contents
ProcedureCHCKID ( Check ID string ) SUBROUTINE CHCKID ( CLASS, MAXLEN, ID ) AbstractValidate an ID string: check for non-printing characters or excessive non-blank length. Required_ReadingNone. KeywordsSTRING UTILITY DeclarationsIMPLICIT NONE CHARACTER*(*) CLASS INTEGER MAXLEN CHARACTER*(*) ID Brief_I/OVARIABLE I/O DESCRIPTION -------- --- -------------------------------------------------- CLASS I A description of the class to which ID belongs. MAXLEN I Maximum allowed non-blank length of ID. ID I The ID string to be validated. Detailed_InputCLASS is a descriptive string indicating the type of object represented by ID. Examples are 'SPK segment identifier', 'DAF internal file name', or 'EK table name'. If the input ID is found to be invalid, CLASS is used in the error message generated by this routine. MAXLEN is the maximum allowed non-blank length of the input ID string. If ID has any non-blank characters at positions greater than MAXLEN, an error will be signaled. ID is the input ID string to be checked. In order to be considered valid, ID must contain only printing characters and must satisfy the condition LASTNB( ID ) < MAXLEN - Detailed_OutputNone. See $Particulars for a description of the effect of this routine. ParametersNone. Exceptions1) If ID contains any nonprintable characters, the error SPICE(NONPRINTABLECHARS) is signaled. 2) If MAXLEN is non-positive, the error SPICE(INVALIDCOUNT) is signaled. 3) If ID contains any non-blank characters past position MAXLEN, the error SPICE(IDSTRINGTOOLONG) is signaled. 4) If CLASS contains any non-printing characters, the error SPICE(NONPRINTABLECHARS) is signaled. 5) CLASS is allowed to be blank. The word 'ID' is used in place of the class string in any error messages in this case. 6) The error messages output by this routine have a maximum length of 320 characters. If substitution of CLASS and ID into the long messages causes overflow, the messages will be truncated on the right. FilesNone. ParticularsThis routine operates by side effects: it validates an ID string and signals an error if the ID has either of the following problems: - There are non-printing characters in the ID string. - The last non-blank character in the string occurs at a location having index higher than a specified value. The error message signaled by this routine contains the offending ID string and indicates the class of item to which ID belongs. The form of the message is: The <CLASS> <'ID'> is invalid; <reason> Examples1) If CLASS = 'segment identifier' MAXLEN = 40 and ID = 'Example EK created on March 28, 1995 by NJB/NAIF' the error message The segment identifier 'Example EK created on March 28, 1995 by NJB/NAIF' is invalid; the last non-blank character is located at position 48. will be signaled. RestrictionsNone. Literature_ReferencesNone. Author_and_InstitutionN.J. Bachman (JPL) J. Diaz del Rio (ODC Space) VersionSPICELIB Version 1.1.0, 02-JUN-2021 (JDR) Added IMPLICIT NONE statement. Edited the header to comply with NAIF standard. SPICELIB Version 1.0.0, 16-JUN-1995 (NJB) |
Fri Dec 31 18:36:01 2021