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

  Purpose:  Deletes specifed index record from HiPer-SEEK index file.

   Syntax:  hs_Delete( <hIndex>, <nVal> )

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

            <nVal> is a integer representing the record number to be deleted.

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

  Errors Returned:

      -4 (BADSEEK) Error while attempting seek during buffer flushing.
      -5 (BADREAD) System generated a read error while reading.
      -6 (BADWRITE) Error while attempting write during buffer flush.
      -7 (RECBOUND) 'record number' is not valid. It is either too low or
         greater than the total number of records indexed.
      -8 (ISDELETED) Specified record number is already marked as deleted.
     -16 (BADPARMS) Invalid parameters were passed to the function.
     -18 (BADHANDLE) Invalid handle was passed to the function.

  Comments:

    1. hs_Delete() is used to set a delete flag for an individual index
    record. The actual index record is not physically deleted from the
    index, rather it is only marked as deleted. Marking an index record as
    deleted prevents it from being returned by hs_Next(). This reflects the
    way deleted records are handled in a .DBF file.

    2. If your application reuses deleted .DBF records, write the new .DBF
    record, undelete (using hs_UnDelete()) the corresponding index record,
    then replace (using hs_Replace()) the index corresponding record.

  Example:

    USE sales EXCL
    h := hs_Open( "SALES.HSX", 10, 1 )
    DO WHILE !eof()
      IF deleted()                        // If DBF record is deleted
        nVal := hs_Delete( h, RecNo() )   // Delete HiPer-SEEK index record
        IF nVal < 1
          ? "HiPer-SEEK delete error: " + LTrim( Str( RecNo() ))
        ENDIF
      ENDIF
      SKIP
    ENDDO


See Also: hs_UnDelete() hs_IfDel() hs_Replace()

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