Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- SIx Driver RDD v3.00 - Reference Guide - <b>hs_filter():</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
  hs_Filter():

  Purpose:  Sets a filter using a HiPer-SEEK index.

   Syntax:  hs_Filter( <cIndex>, <cVal>, [cExpr], [nBufSize], [nOpenMode] )

    Where:  <cIndex> is the Hiper-SEEK index file name to use for the filter.
              If index extension is not specified, defaults to .HSX.

            <cVal> is a space-delimited string of one or more tokens to look
              for.

            [cExpr] is an optional expression to validate "hits" with.  If no
              parameter (or an empty string) is passed, "fuzzy" matches are
              accepted.

            [nBufSize] is an optional buffer size in kbytes.  Default is 8.

            [nOpenMode] is an optional Open Mode.  Default is 2.  Valid values
              are:

                  0 = READ-WRITE + SHARED
                  1 = READ-WRITE + EXCLUSIVE
                  2 = READ-ONLY + SHARED
                  3 = READ-ONLY + EXCLUSIVE

  Returns:  The number of records matching the filter condition.

  Comments:  This function combines the HiPer-SEEK's Fast Text Search roots
             with the Mach SIx query optimizer's Roll-Your-Own filter
             technology.

  Example:

    #include "inkey.ch"

    LOCAL cExpr := "test->FIRST + test->LAST + test->STREET + test->CITY"
    LOCAL nCount := 0, lStrict := .F.
    LOCAL cSearch := "Steve John Robert"
    LOCAL GetList := {}

    CLS
    USE test EXCL

    IF !file("TEST.HSX")
      @ 0,0 "Building HiPer-SEEK Index..."
      hs_Index( "TEST.HSX", cExpr, 2 )
      ?? "Done!"
      Inkey(1)
      CLS
    ENDIF

    WHILE .T.
      cSearch := PadR( cSearch, 59 )
      @ 0,0 SAY "Search Values.....:" GET cSearch
      @ 1,0 SAY "Strict Match (Y/N):" GET lStrict PICTURE "Y"
      READ
      IF LastKey() == K_ESC
        CLS
        EXIT
      ENDIF
      cSearch := AllTrim( cSearch )

      @ 3,0 SAY "Setting HiPer-SEEK Filter ..."

      nCount := hs_Filter( "TEST.HSX", cSearch, iif( lStrict, cExpr, "" ))

      ?? "Done!"
      @ 4,0 SAY LTrim( Str( nCount )) + " records meeting filter condition."

      @ 6,0 SAY "Press any key to browse the matching records..."
      Inkey(0)

      GO TOP
      Browse()
      CLS
    ENDDO



See Also: m6_SetFilter() m6_NewFilter() hs_Next()

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