Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- FAST TEXT SEARCH for Clipper v.2.0 - <b>cftsdelete( <cftshandle>, <expn> )</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
   CftsDelete( <CFTShandle>, <expN> )

       Purpose

   The index record with the specified 'record number' is marked as 
   deleted.

       Parameters

   <CFTShandle> is an integer referring to a CFTS index. <expN> is a 
   integer representing the record number to be deleted.

       Return Value

   Returns 1 if successful, else a negative integer (indicating an    
   error) as outlined below.

       Errors Returned

    -4   (BADSEEK): Error while attempting seek.
    -5   (BADREAD): System generated a read error while reading.
    -6   (BADWRITE): Error while attempting write.
    -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. CftsDelete() 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 CftsNext(). 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 CftsUnDel()) the corresponding index 
   record, then replace (using CftsReplac()) the index corresponding 
   record.

       Example

   .
   .
   .
   use sales
   xhandle = CftsOpen( 'sales.ia', 10, .T. )
   do while ! eof()
        if deleted()                             && if DBF record is deleted
        result = CftsDelete( xhandle, recno() )  && mark deleted
                                                 && in CFTS index
             if result <1
             ? 'error deleting record ' + str( recno() ) + 'in CFTS index'
             endif
        endif
        skip
   enddo
   .
   .
   .
   !seealso:




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