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

  Purpose:  Replaces the current index entry for <nVal> with the new value
            of <cExpr>.  There must be at least <nVal> records already
            indexed.

   Syntax:  hs_Replace( <hIndex>, <cExpr>, <nVal> )

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

            <cExpr> is a string containing the data to be indexed. There is
              no length limit to the index string, however, strings of length
              100 to 4000 characters (or less) usually provide a satisfactory
              alias rate.  Strings longer than this can result in higher than
              acceptable alias rates.

            <nVal> is an integer representing the record number to be
              replaced.

  Returns:  1 if successful or a negative integer indicating an error.

  Errors Returned:

      -4 (BADSEEK) Error while attempting seek during buffer flushing.
      -6 (BADWRITE) Error while attempting write during buffer flush.
      -7 (RECBOUND) <nVal> is not valid. It is either too low or greater than
         the total number of records indexed. Test the actual value being
         supplied as <nVal>. If the record pointer is set to point past the
         last record in the .DBF file (by using a SKIP command to skip past
         the last record), Clipper's RECNO() returns LASTREC() + 1.  This
         value will result in a -7 (RECBOUND) error if used as the <nVal>
         parameter to hs_Replace().
     -16 (BADPARMS) Invalid parameters were passed to the function.
     -18 (BADHANDLE) Invalid handle was passed to the function.


  Example:

    USE test EXCL
    h := hs_Open( "NAMES.HSX", 8, 1 )
    GOTO 10
    cStr := Trim( test->FIRST ) + " " + Trim( test->LAST )
    IF hs_Replace( h, cStr, RecNo() ) < 1
      ? "HiPer-SEEK replace error on record #" + LTrim( Str( RecNo() ))
    ENDIF


See Also: hs_Add() hs_Delete()

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