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

  1. /*
  2.    Listing 26.1 Displaying Messages with WHEN
  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. function main
  14. memvar name, address, city, getlist
  15. dbcreate('temp', { { 'name', 'C', 20, 0 } , ;
  16.                    { 'address', 'C', 25, 0 } , ;
  17.                    { 'city', 'C', 20, 0 } } )
  18. use temp new
  19. append blank
  20. cls
  21. name := temp->name
  22. address := temp->address
  23. city := temp->city
  24. @ 10,0 get name    when fieldhelp(24, 1, "Please enter a name")
  25. @ 11,0 get address when fieldhelp(24, 1, "Please enter an address")
  26. @ 12,0 get city    when fieldhelp(24, 1, "Please enter a city")
  27. read
  28. replace temp->name with name, temp->address with address,;
  29.         temp->city with city
  30. return nil
  31.  
  32.  
  33. static function fieldhelp(row, col, msg)
  34. @ row, col say padr(msg, 50)
  35. return .t.
  36.  
  37. // end of file CHP2601.PRG
  38.