KPG1_SHORT

Checks whether a string matches a supplied abbreviation template

Description:

This routine returns .TRUE. if the supplied test string matches the supplied abbreviation template. All characters in the template must be matched by the corresponding characters in the test string, with the exception that it is permissable for the test string to end anywhere following the first occurrence of the mark string (the mark string itself should not be matched in the test string). The template sub-string in front of the first mark string thus gives the minimum abbreviation which the test string can use.

For instance, if MARK= and TEMPLT= VECTORS , then the test string matches if the first 4 characters are VECT and any remaining characters match ORS .

Invocation

RESULT = KPG1_SHORT( TEMPLT, TEST, MARK, CASE, STATUS )

Arguments

TEMPLT = CHARACTER ( ) (Given and Returned)
The abbreviation template. Trailing blanks are ignored.
TEST = CHARACTER ( ) (Given and Returned)
The test string. Trailing blanks are ignored.
MARK = CHARACTER ( ) (Given and Returned)
The string which marks the end of the minimum abbreviation in TEMPLT. Trailing blanks are ignored.
CASE = LOGICAL (Given)
Should the match be case sensitive?
STATUS = INTEGER (Given and Returned)
The global status.

Function Value

KPG1_SHORT = LOGICAL Returned .TRUE. if and only if the supplied test string matches the template.