%N match %F $MIR/src/subs/match.for
%D Check if a string occurs in a list of valid strings
%P bpw
%: strings
%B
      logical function match ( input, valid_strings, nr )
      character*(*) input
      character*(*) valid_strings
      integer       nr

 match does a minimal match of the input string 'input' on the comma-separated
 list of valid strings. It also returns the string number.

 On output the value of match indicates whether or not any match was found.
 This implies that the input variable input can not be an explicit string,
 but must be a declared character variable.
 The matching is minimal, that means that if e.g. valid_strings has the value
 'terminal,printer,file' and input is 'f', a match is produced. The return
 value of nr will be 3.

 Input:
   input:         the string of which it has to be checked if it matches
   valid_strings: a comma-separated list of valid input strings
 Output:
   nr:            the string number of input; 0 if there was no match
