home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 5 / 05.iso / a / a012 / 1.ddi / CHAP16.EXE / CHP1602.PRG < prev    next >
Encoding:
Text File  |  1991-04-30  |  1.0 KB  |  45 lines

  1. /*
  2.    Listing 16.2  Record customer payment - version 2
  3.    Author: Joe Booth
  4.    Excerpted from "Clipper 5: A Developer's Guide"
  5.    Copyright (c) 1991 M&T Books
  6.                       501 Galveston Drive
  7.                       Redwood City, CA 94063-4728
  8.                       (415) 366-3600
  9. */
  10.  
  11. LOCAL ok := .F.
  12. memvar chk_amount
  13. begin sequence
  14.    select CUSTOMER
  15.    if rec_lock(15)          // Lock the current record
  16.       replace CUSTOMER->balance with ;
  17.               CUSTOMER->balance - chk_amount
  18.       unlock
  19.    else
  20.       break
  21.    endif
  22.    select INVOICE
  23.    if rec_lock(15)          // Lock the current record
  24.       replace INVOICE->paid with ;
  25.               INVOICE->paid + chk_amount
  26.       unlock
  27.    else
  28.       break
  29.    endif
  30.    select PAYMENT
  31.    if rec_lock(15)          // Lock the current record
  32.       replace PAYMENT->posted with .T.
  33.       unlock
  34.    else
  35.       break
  36.    endif
  37.    ok :=.T.
  38. end sequence
  39. if ! ok
  40.    ? "ERROR: Transaction not completely applied..."
  41. endif
  42. return
  43.  
  44. // end of file CHP1602.PRG
  45.