Previous: prsbrk Up: ../plot79_p.html Next: prsckt
LOGICAL FUNCTION PRSCK (STATUS,KEYSTR,LENSTR,MAXKEY,PKEY,
X LKEY,NKEY)
C$ (Parse - Check Keys)
C$ Given a list of keywords (ordered alphabetically according
C$ to the ASCII collating sequence) packed in KEYSTR(*) in the
C$ form
C$
C$ *fKEY1*fKEY2*fKEY3*...*fKEYN
C$
C$ where the first character is the key separator character,
C$ return the locations, lengths, and number of keys. The
C$ function value and STATUS code are .TRUE. on success, and
C$ .FALSE. on failure. The key separator character may be
C$ any character which is not a keyword character. Letter
C$ case is ignored in the comparisons.
C$
C$ The character following each key separator is an OPTIONAL
C$ flag character, always a digit in the range 0..7, with 0
C$ being the standard choice, and the one assumed by default
C$ if the character following the key separator is not one of
C$ the in-range digits (and therefore is the first character
C$ of the key). It encodes 3 flag bits, and is obtained by
C$ summing the following option values:
C$
C$ 1 - Abbreviation: Accept a match with this keyword as an
C$ abbreviation for another keyword in the
C$ table, even if the match is ambiguous.
C$ For example, a table in a graphics
C$ application might contain the keywords
C$ LINE, LINE-WIDTH, LINE-STYLE, and
C$ LINE-INTENSITY. LINE would be ambiguous
C$ unless it were marked as an abbreviation.
C$ Similarly, L, LI, and LIN could also be
C$ present with the abbreviation flag set.
C$ 2 - No Recognize: Do not recognize this keyword even if it
C$ would otherwise be an acceptable match.
C$ For example, if DELETE were a keyword,
C$ and the only one beginning with D, one
C$ might wish to include keywords D and DE
C$ with the No Recognize flag set, in order
C$ to disallow matches with them, forcing at
C$ least 3 letters to be typed to recognize
C$ DELETE. Any keyword with this flag set
C$ is suppressed in a typeout of possible
C$ matches by PRSSHO.
C$ 4 - Invisible: Allow matches with this keyword, but do
C$ not display it in a typeout of possible
C$ matches by PRSSHO. For example, if the
C$ keyword PRINT is preferred over LIST,
C$ both could be in the keyword table and be
C$ recognized, but LIST could have the
C$ Invisible flag set. This lets newer
C$ program versions retain command
C$ compatibility with older ones, yet
C$ gradually wean users away from use of
C$ obsolete command words.
C$
C$ The input arguments are:
C$
C$ KEYSTR(*)...........Packed keyword string.
C$ LENSTR..............Number of characters in KEYSTR(*).
C$ MAXKEY..............Dimension limit of PKEY(*) and LKEY(*).
C$
C$ The output arguments are:
C$
C$ STATUS.............. .TRUE. - The keys are correctly
C$ ordered in KEYSTR(*). The
C$ alphabetical order MUST be
C$ correct for a binary search
C$ by FUNCTION PRSIK to work
C$ successfully.
C$ .FALSE. - The keys are out of order, or
C$ NKEY exceeds MAXKEY.
C$ PKEY(*).............Array of pointers to the beginning of
C$ the keys in KEYSTR(*).
C$ LKEY(*).............Array of lengths of the keys in
C$ KEYSTR(*).
C$ NKEY................Number of keys found in KEYSTR(*), and
C$ number of entries in PKEY(*) and
C$ LKEY(*). If NKEY > MAXKEY on return,
C$ there was insufficient space in PKEY(*)
C$ and LKEY(*), but the array bounds have
C$ not been exceeded.
C$
C$ See the abstract of PRSIK for applications of this routine
C$ and a table of the ASCII character set. PRSSHO can be used
C$ to display all or part of the list.
C$ (25-APR-84)