Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Force 4.0 Reference - wildequal() perform a wildcard search of a mask string http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 wildequal()         Perform a wildcard search of a mask string
------------------------------------------------------------------------------
 Declaration
   string.hdr

 Syntax
   func logical wildequal extern
   param const char cMask, ;
         const char cString

 Arguments
   cMask is the string to search for.
   cString is the string to scan.

 Return
   A logical indicating if a match was found.

 Description
   This function accomplishes a "wildcard" search of cMask within cString
   using the * and ? characters. It is similar to a DOS directory search.

   ? indicates any character may occupy the specified position while *
   indicates any character may occupy the current and remaining positions
   within string.

   For example, if mask is

   ??ABC*

   then the following strings are located by wildequal():

   ddABC
   AaABCdef
   ABC
   12ABC

 Example
   #define EXAMPLE_STRING
   #include example.hdr

   proc Test_wildequal
   vardef
      uint n
   enddef
   ? "Month names that start with 'Ju':"
   for n := 0 to 11
      if wildequal( "Ju*", __monthnames[ n ] )
         ? __monthnames[ n ]
      endif
   next
   ?
   ? "Day names whose 4-6th characters are 'day':"
   for n := 0 to 6
      if wildequal( "???day", __daynames[ n ] )
         ? __daynames[ n ]
      endif
   next
   endproc

   proc main
   Test_wildequal()
   endproc

See Also: exist() pathof()

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