[<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
VS_DelRec()          Delete a record so VS_AddRec() can re-use it

Description:

  VS_DelRec() deletes the current record in the database associated with
  the current work area.  VS_DelRec() will first attempt to obtain a
  record lock on the current record.  If successfully locked,
  VS_DelRec() will reset each field in the record to the empty value for
  its field type and then mark the record for deletion. VS_DelRec()
  releases the record lock before returning!

Syntax:     

  l_Deleted = VS_DelRec()

Pass:       

  Nothing

Return:     

  l_Deleted is a logical expression that will be set to .T. if the
  current record was successfully deleted, otherwise .F.

Notes:      

  Because VS_DelRec() resets each field to its empty value, EXTREME care
  should be taken with regard to index location, etc.

Example:    

  * The following example will delete all records with the
  * last name of "SMITH"

  DO WHILE .T.

     SEEK "SMITH"    && continually SEEKing is necessary
                     && because we are reseting the key
                     && field (and all fields) to its
                     && empty value, thus changing the
                     && position within the index!!!!!

     IF .NOT. FOUND()
        EXIT
     ENDIF

     IF .NOT. VS_DelRec()
        VS_DIE("Couldn't delete a record!")
     ENDIF

  ENDDO

Usage:      

See Also: VS_AddRec()
This page created by ng2html v1.05, the Norton guide to HTML conversion utility. Written by Dave Pearson