home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 5 / 05.iso / a / a012 / 1.ddi / CHAP19.EXE / CHP1917.PRG < prev    next >
Encoding:
Text File  |  1991-04-30  |  875 b   |  36 lines

  1. /*
  2.    Listing 19.17  SUBSET database example
  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. field state, id_code
  12. local jj, flds
  13. use CUSTOMER new
  14. index on state+id_code to cust
  15. seek "PA"
  16. copy to pa_cust while state == "PA"     // Create subset
  17. use PA_CUST new                         // Use the subset file
  18. go top
  19. browse()                    // Allow user to work with subset
  20. flds := fcount()
  21. go top
  22. while !eof()
  23.    select CUSTOMER
  24.    seek PA_CUST->state + PA_CUST->id_code
  25.    if eof()
  26.       append blank
  27.    endif
  28.    for jj = 1 to flds
  29.       Fieldput(jj, PA_CUST->(fieldget(jj)))
  30.    next
  31.    select PA_CUST
  32.    skip +1
  33. enddo
  34.  
  35. // end of file CHP1917.PRG
  36.