home *** CD-ROM | disk | FTP | other *** search
/ Power CD-ROM!! 7 / POWERCD7.ISO / prgmming / clipper / gt_delre.prg < prev    next >
Text File  |  1993-10-14  |  1KB  |  75 lines

  1. /*
  2.     File......: GT_DelRec.prg
  3.     Author....: Martin Bryant
  4.     BBS.......: The Dark Knight Returns
  5.     Net/Node..: 050/069
  6.     User Name.: Martin Bryant
  7.     Date......: 04/02/93
  8.     Revision..: 1.0
  9.  
  10.     This is an original work by Martin Bryant and is placed
  11.     in the public domain.
  12.  
  13.     Modification history:
  14.     ---------------------
  15.  
  16.     Rev 1.0 04/02/93
  17.     PD Revision.
  18. */
  19.  
  20. /*  $DOC$
  21.  *  $FUNCNAME$
  22.  *      GT_DELREC()
  23.  *  $CATEGORY$
  24.  *      General
  25.  *  $ONELINER$
  26.  *      Mark a record as deleted
  27.  *  $SYNTAX$
  28.  *      GT_DelRec(<lMove>) => lSuccess
  29.  *  $ARGUMENTS$
  30.  *      <lMove> should the system move to another record
  31.  *      after the deletion ?
  32.  *  $RETURNS$
  33.  *      .T. / .F.
  34.  *  $DESCRIPTION$
  35.  *      Mark a record as deleted
  36.  *  $EXAMPLES$
  37.  *      IF .NOT. GT_DelRec(.T.)
  38.  *          ? 'Error'
  39.  *      ENDIF
  40.  *  $SEEALSO$
  41.  *
  42.  *  $INCLUDE$
  43.  *
  44.  *  $END$
  45.  */
  46.  
  47. #include "GT_LIB.ch"
  48.  
  49. FUNCTION GT_DelRec(lMoveAfter)
  50.  
  51. LOCAL lSuccess := .F.
  52.  
  53. Default lMoveAfter to .F.
  54.  
  55. //  Lock, delete, unlock
  56. IF GT_Locking(.F.)
  57.     DBDELETE()
  58.     DBUNLOCK()
  59.     lSuccess := DELETED()
  60. ENDIF
  61.  
  62. // Move to an undeleted record ?
  63. IF lMoveAfter
  64.     DBSKIP(1)
  65.     IF EOF()
  66.         DBGOTOP()
  67.     ENDIF
  68. ENDIF
  69.  
  70. /*
  71.     End of GT_DelRec()
  72. */
  73. RETURN(lSuccess)
  74.  
  75.