Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- SuperLib 3.50 - function _wildcard() http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 FUNCTION _WILDCARD()

  Short:
  ------
  _WILDCARD() Wild Card String Compare

  Returns:
  --------
  <lMatched> => match

  Syntax:
  -------
  _wildcard(<cPattern>,<cTarget>)

  Description:
  ------------
  <cPattern> is a model/wildcard pattern to search for
  and <cTarget> is a string to compare with model/pattern in
  <cPattern>.

  Like DOS wildcards, but for a string.

  <cPattern> is a string of wild cards interspersed
  with literal text to compare against the contents of <cTarget>.
  The following conventions for wild cards are followed:

    1. "*"     stands for any group of characters.

                W*r     gives fields beginning with
                     "W", ending with "r".
                *w*r    gives fields having "w"
                    before last character "r".

    2. "?"     stands for any single character.
                J?n?s   gives Janes, Janus, Jones, and so
                on.

  Examples:
  ---------
   _wildcard("Pr?fon*e", "Prefontaine" )
   // returns -> True

   _wildcard("Pr?on*e", "Prefontaine" )
   // returns -> False

   _wildcard("Stei*er","Prefontaine")
   // returns -> False

  Notes:
  -------
  This was a C function in previous SuperLibs. Now 5.01
  Clipper source code, and more reliable.

  Source:
  -------
  S_WILD.PRG


Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson