prefix |
Table of contents
ProcedurePREFIX (Prefix a character string) SUBROUTINE PREFIX ( PREF, SPACES, STRING ) AbstractAdd a prefix to a character string. Required_ReadingNone. KeywordsASSIGNMENT CHARACTER STRING DeclarationsIMPLICIT NONE CHARACTER*(*) PREF INTEGER SPACES CHARACTER*(*) STRING Brief_I/OVARIABLE I/O DESCRIPTION -------- --- -------------------------------------------------- PREF I Prefix. SPACES I Number of spaces separating prefix and suffix. STRING I-O Suffix on input, string on output. Detailed_InputPREF is the prefix to be added to the string. Trailing blanks are ignored. (A blank prefix is interpreted as a null prefix.) SPACES is the number of spaces (blanks) in the output string separating the last non-blank character of the prefix from the first (blank or non-blank) character of the suffix. Typically, this will be zero or one. If not positive, SPACES defaults to zero. STRING on input is the suffix to which the prefix is to be added. Leading blanks are significant. Detailed_OutputSTRING on output is the is the prefixed string. If STRING is not large enough to contain the output string, the output string is truncated on the right. STRING may NOT overwrite PREF. ParametersNone. ExceptionsError free. 1) If SPACES is negative it is treated as zero. FilesNone. ParticularsThe suffix is shifted to the right to make room for the prefix and required spaces, which are then added to the front of the string. (The shift operation handles any necessary truncation.) ExamplesThe following examples illustrate the use of PREFIX. PREF STRING (input) SPACES STRING (output) ---------- -------------- ------ --------------- 'abc ' 'def ' 0 'abcdef ' 'abc ' 'def ' 1 'abc def' 'abc ' ' def ' 0 'abc def' 'abc ' ' def ' 1 'abc de' ' abc ' 'def ' 0 ' abcdef' ' abc ' 'def ' 1 ' abc de' ' abc ' ' def ' -1 ' abc de' ' ' 'def ' 0 'def ' ' ' 'def ' 1 ' def ' ' abc ' ' ' 0 ' abc ' Restrictions1) PREF and STRING must be distinct. Literature_ReferencesNone. Author_and_InstitutionJ. Diaz del Rio (ODC Space) W.L. Taber (JPL) I.M. Underwood (JPL) VersionSPICELIB Version 1.1.0, 18-MAR-2021 (JDR) Added IMPLICIT NONE statement. Edited the header to comply with NAIF standard. SPICELIB Version 1.0.1, 10-MAR-1992 (WLT) Comment section for permuted index source lines was added following the header. SPICELIB Version 1.0.0, 31-JAN-1990 (WLT) (IMU) |
Fri Dec 31 18:36:40 2021