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

  Syntax:  Sx_SeekLast( xValue [, lSoft] )

           xValue = The value in the currently active order to search for.
           lSoft  = Logical value indicating SOFTSEEK mode to be used.  The
                    default value is .F., and will not perform a SOFTSEEK.
                    If .T. is passed, and if an exact match is not found,
                    the record pointer will be positioned on the key with
                    next greater value.

  Returns:  Logical .T. is an exact match was found, .F. if not.

  Description:  Similar to Clipper's dbSeek(), except that it finds the
                last occurrence of a key value instead of the first.

                Using this fuction is substantially faster than SEEK'ing to
                the first occurrence and then SKIP'ing WHILE to the end of
                the matching keys.

                Sx_SeekLast() properly handles the DESCENDING flag of the
                index.

  Example:

    #include "SIXNSX.CH"

    USE test VIA "SIXNSX"
    INDEX ON LAST + STR(AGE,2) TO AGE

    // Find first entry in index
    IF dbSeek( "Smith" )
      ? "The youngest Smith is " + RTrim( FIRST ) + " " + RTrim( LAST )
      ?? " at " + AllTrim( Str( AGE )) + " years old."

      // Find last entry in index
      Sx_SeekLast( "Smith" )
      ? "The oldest Smith is " + RTrim( FIRST ) + " " + RTrim( LAST )
      ?? " at " + AllTrim( Str( AGE )) + " years old."

    ELSE
      ? "No Smith found!"
    ENDIF



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