home *** CD-ROM | disk | FTP | other *** search
/ Share Gallery 1 / share_gal_1.zip / share_gal_1 / DB / DB012B.ZIP / VPI1MANL.ZIP / CHARITY.ZIP / DONLABEL.PRG < prev    next >
Text File  |  1991-12-29  |  2KB  |  59 lines

  1. ***************************************************************************
  2. **  DONLABEL.PRG
  3. **  (C) Copyright 1990, Sub Rosa Publishing Inc.
  4. **  A demonstration program provided to VP-Info users.
  5. **  This program may be copied freely. If it is used in commercial code,
  6. **  please credit the source, Sub Rosa Publishing Inc.
  7. **
  8. **  DONLABEL is a subroutine on MENU.PRG, used to print 3-across labels
  9. **  of the list of donors or solicitors.  Called by MENU.PRG twice...once
  10. **  each with DONOR.DBF and SOLICIT.DBF.  This works because both files
  11. **  have same names for all fields used by subroutine.
  12. **
  13. **  DONLABEL is compatible with all current versions of VP-Info.
  14. **
  15. **  Sid Bursten and Bernie Melman
  16. **  May 9,1990
  17. ***************************************************************************
  18. WINDOW
  19. ERASE
  20. INDEX on ZIP+!(NAME) to xlabel  ;post office wants letters in zip-code order
  21. CLS
  22. SET print on
  23. SET width to 130
  24. GOTO top
  25. DO WHILE .not. eof
  26.    REPEAT 3 times varying xfld      ;clear out output matrix
  27.       REPEAT 3 times varying xcolumn
  28.          labelout[xfld,xcolumn]=' '
  29.       ENDREPEAT
  30.    ENDREPEAT
  31.    REPEAT 3 times varying xcolumn   ;fill 3-across input matrix
  32.       label[1,xcolumn]= ltrim(trim(FNAME)+" "+NAME)
  33.       label[2,xcolumn]= ADDRESS
  34.       label[3,xcolumn]= ltrim(trim(CITY)+", "+trim(STATE)+"  "+ZIP)
  35.       xline2=0
  36.       REPEAT 3 times varying xline  ;transfer only filled lines to output
  37.          IF label[xline,xcolumn]>' '
  38.             xline2=xline2+1
  39.             labelout[xline2,xcolumn]=label[xline,xcolumn]
  40.          ENDIF
  41.       ENDREPEAT
  42.       SKIP                       ;get next record
  43.       IF eof                     ;quit when end of file reached
  44.          BREAK
  45.       ENDIF
  46.    ENDREPEAT
  47.    ? labelout                    ;print 3-across output matrix
  48.    REPEAT 2 times                ;3-line matrix plus blank line needs
  49.       ?                          ;  2 extra form feeds to get to next label
  50.    ENDREPEAT
  51. ENDDO
  52. REPEAT 6 times                   ;skip one more row of labels to make
  53.    ?                             ;  it easier to remove labels from printer
  54. ENDREPEAT
  55. SET print off
  56. RETURN
  57. *
  58. *                    *** end of program DONLABEL.PRG ***
  59.