Routine ID: I303 | |
---|---|
Author(s): G. Kozlovsky | Library: KERNLIB |
Submitter: | Submitted: 07.09.1986 |
Language: Fortran | Revised: |
OBSOLETE
Please note that this routine has been obsoleted in CNL 219. Users are
advised not to use it any longer and to replace it in older programs.
No maintenance for it will take place and it will eventually disappear.
Suggested replacement: CHPACK (M432)
RDWORD is a lexical analyser which reads numbers, alphabetic names and special characters from its internal buffer in format free form. The definitions of the three above mentioned lexical entities are as follows:
A number has the form sd.dEsdx.
An alphabetic name has the form ax and an alphanumeric name the form ady.
Lexical entities may be separated by any number of blanks. The internal buffer has a length of 80 characters. A blank is added logically as an 81st character.
Structure:
SUBROUTINE subprograms
User Entry Names:
RDWORD, RDLOAD, RDSKIP, RDENDB
Internal Entry Names:
RALPH, | RDIGI, | RDINT, | RDMANT, | RDNAME, | RDNEXT, | RDSKPB, | RDUPCH, |
RDUPST |
Usage:
CALL RDLOAD(STRING)Puts STRING (of type CHARACTER*(*)) into the internal buffer of RDWORD and sets the internal pointer to the first position of the buffer. If STRING is shorter than the buffer length the rest of the buffer is filled with blanks. If STRING is longer than the buffer (80 characters), the remainder of it will be truncated.
CALL RDWORD(INUM,FPNUM,NAME,KTYPE)Causes the next object (if any) to be read from the internal buffer starting from the current position of the internal pointer to the buffer while skipping leading blanks until the first non-blank character or the end of the buffer is encountered, and positions the internal pointer to the terminating character of the object.
On exit, the arguments have the following values:
When an integer or floating point number was read:
When a name or special character was read:
ERROR IN RDWORD: NAME READ IS TOO LONG. IT IS TRUNCATED TO: NTRUNCis printed. NTRUNC stands for the truncated name.
When an "end of buffer" is reached:
CALL RDSKIPSets the internal pointer to 81 which means "end of buffer".
CALL RDMODE(I)A call with will force RDWORD to read, as variables of type CHARACTER, sets of alphanumeric characters starting with a letter, such as ALPHA99.
The default mode (purely alphabetic names that will be terminated by a
digit will be restored by a call with
.
In any expression of type LOGICAL
RDENDB()has the value .TRUE. if the end of the buffer was reached, and .FALSE. otherwise. RDENDB is of type LOGICAL.
Output and Graphical Data Presentation