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

  1. ***************************************************************************
  2. **  SOLEDIT.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. **  SOLEDIT is a subroutine on MENU.PRG, used to edit and add solicitor
  9. **  records to SOLICIT.DBF.  This is similar to DONEDIT, which is more
  10. **  fully commented.
  11. **
  12. **  SOLEDIT is compatible with all current versions of VP-Info.
  13. **
  14. **  Sid Bursten and Bernie Melman
  15. **  May 9,1990
  16. ***************************************************************************
  17. ON escape
  18.    WINDOW
  19.    CLEAR gets
  20.    CANCEL
  21. ENDON
  22. WINDOW
  23. SET deleted off
  24. USE solicit index sol_name,sol_code
  25. IF recno(1)=0
  26.    APPEND blank
  27. ENDIF
  28. GOTO dbf(recs)               ;goto last record added to file
  29. ERASE
  30. TEXT .2
  31. DO WHILE t
  32.    IF solicitor=' '
  33.       mfname=fname
  34.       mname=name
  35.       recnum=#
  36.       WINDOW 10,10,17,69 double
  37.       CLEAR gets
  38.       TEXT
  39. .. solicitor,!!!-!-99
  40.  
  41.                      Record to add
  42.  
  43.   First Name... @mfname
  44.    Last Name... @mname
  45.       ENDTEXT
  46.       WINDOW
  47.       READ
  48.       finder=!(left(mname,3)+left(mfname,1))
  49. *     LAST &finder       ;in VP-Info only
  50.       FIND &finder
  51.       IF #=0
  52.          finder=finder+'01'
  53.       ELSE
  54.          LIMIT 4         ;this and following 2 commands not required in
  55.          GOTO bottom     ;  VP-Info when LAST is used instead of FIND
  56.          LIMIT
  57.          num=val(right(solicitor,2))
  58.          IF num<99
  59.             finder=finder+right(str(101+num,3),2)
  60.          ELSE
  61.             finder='******'
  62.          ENDIF
  63.       ENDIF
  64.       GOTO recnum
  65.       REPLACE fname with mfname,name with mname,solicitor with finder
  66.       ERASE
  67.       TEXT .2
  68.       :field=field(address)
  69.    ELSE
  70.       :field=field(fname)
  71.    ENDIF
  72.    @ 0,0 say pic(#,'999,999')
  73.    @ 0,77 say iff(deleted(1),'DEL','   ')
  74.    READ
  75.    kn=:key
  76.    DO CASE kn
  77.    CASE kn=17                     ; ^Q=no update
  78.       NOUPDATE
  79.    CASE kn=329                    ; <PgUp>=Beginning of file
  80.       SKIP -1
  81.       IF #=0
  82.          GOTO top
  83.          RING
  84.       ENDIF
  85.    CASE kn=337                    ; <PgDn>=End of file
  86.       SKIP
  87.       IF eof
  88.          GOTO bottom
  89.          RING
  90.       ENDIF
  91.    CASE kn=375                    ; ^<Home>=Beginning of file
  92.       GO top
  93.    CASE kn=373                    ; ^<End>=End of file
  94.       GOTO bottom
  95.    CASE kn=374                    ; ^<PgDn>=Add a record
  96.       GOTO top
  97.       IF solicitor>' '
  98.          APPEND blank
  99.       ENDIF
  100.    CASE kn=335                    ; <End>=Quit
  101.       BREAK
  102.    ENDCASE kn
  103. ENDDO
  104. CLOSE all
  105. RETURN
  106. *
  107. *                     *** end of program soledit.prg ***
  108.