home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 5 / 05.iso / a / a012 / 1.ddi / CHAP26.EXE / CHP2603.PRG < prev    next >
Encoding:
Text File  |  1991-06-12  |  868 b   |  32 lines

  1. /*
  2.    Listing 26.3 Example of Nested READ
  3.    Author: Greg Lief
  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. //───── NOTE: must compile with the /N option!
  12.  
  13. memvar getlist // to squelch compiler warnings
  14.  
  15. function main
  16. local x := 0, mdate := date() + 14
  17. cls
  18. @ 10, 10 say "Balance: " get x picture '#####.##' valid credit(@x)
  19. @ 11, 10 say "Due date:" get mdate
  20. read
  21. return nil
  22.  
  23. function credit(balance)
  24. local x := 0, getlist := {}, oldscrn := savescreen(10, 40, 10, 64)
  25. @ 10, 40 say "Credit (if any):" get x picture '#####.##'
  26. read
  27. balance -= x        // subtract credit from original balance
  28. restscreen(10, 40, 10, 64, oldscrn)
  29. return .t.
  30.  
  31. // end of file CHP2603.PRG
  32.