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_next():</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
  hs_Next():

  Purpose:  Assuming that a hs_Set() call has occurred immediately preceding
            the first call to hs_Next() for a given search, this function
            performs the actual 'find' operation using the index. The first
            call returns the record number of the first hit, the second of
            the second hit, etc. When all possible hits have been returned,
            the function returns zero.

   Syntax:  hs_Next( <hIndex> )

    Where:  <hIndex> is an integer handle of a HiPer-SEEK index file.

  Returns:  Returns the record number of the next possible match. If zero,
            there are no more matches. A negative return value indicates an
            error. Each hs_Next() call results in the return of a single
            number.

  Errors Returned:

      -5 (BADREAD) Error while attempting disk read.
     -16 (BADPARMS) Invalid parameters were passed to the function.
     -18 (BADHANDLE) Invalid handle was passed to the function.


  Example:

    // Lists all record numbers that contain the word "John" anywhere in
    // either the FIRST, LAST, STREET, or CITY fields.  Uses hs_Verify()
    // to prevent "fuzzy" matches.

    LOCAL cExpr := "test->FIRST + test->LAST + test->STREET + test->CITY"
    LOCAL bExpr := &( "{||" + cExpr + "}" )
    LOCAL cVal := "John", h := 0, nRec := 0

    CLS
    USE test EXCL

    IF !file("TEST.HSX")
      ? "Building HiPer-SEEK Index..."
      h := hs_Index( "TEST.HSX", cExpr, 2 )
    ELSE
      h := hs_Open( "TEST.HSX", 8, 1 )
    ENDIF

    hs_Set( h, cVal )
    nRec := hs_Next( h )

    DO WHILE nRec > 0
      dbGoto( nRec )
      IF hs_Verify( bExpr, cVal )
        ? nRec
      ENDIF
      nRec := hs_Next( h )
    ENDDO

    hs_Close( h )



See Also: hs_Set() hs_Verify()

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