home *** CD-ROM | disk | FTP | other *** search
/ Shareware Overload / ShartewareOverload.cdr / database / sri314_b.zip / CHARITY.ZIP / SOLEDIT.PRG < prev    next >
Text File  |  1990-06-07  |  3KB  |  112 lines

  1. ***************************************************************************
  2. **  SOLEDIT.PRG
  3. **  (C) Copyright 1990, Sub Rosa Publishing Inc.
  4. **  A demonstration program provided to SR-Info and 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 SR-Info and
  13. **  VP-Info, but VP-Info actually has an easier way of accomplishing the
  14. **  same task.  EDIT OFF can be used instead of READ, thus eliminating the
  15. **  need to program function keys by yourself.  In addition, the code
  16. **  that creates new code numbers could be moved into an ON FIELD structure.
  17. **
  18. **  Sid Bursten and Bernie Melman
  19. **  May 9,1990
  20. ***************************************************************************
  21. ON escape
  22.    WINDOW
  23.    CLEAR gets
  24.    CANCEL
  25. ENDON
  26. WINDOW
  27. SET deleted off
  28. USE solicit index sol_name,sol_code
  29. IF recno(1)=0
  30.    APPEND blank
  31. ENDIF
  32. GOTO dbf(recs)               ;goto last record added to file
  33. ERASE
  34. TEXT .2
  35. DO WHILE t
  36.    IF solicitor=' '
  37.       mfname=fname
  38.       mname=name
  39.       recnum=#
  40.       WINDOW 10,10,17,69 double
  41.       CLEAR gets
  42.       TEXT
  43. .. solicitor,!!!-!-99
  44.  
  45.                      Record to add
  46.  
  47.   First Name... @mfname
  48.    Last Name... @mname
  49.       ENDTEXT
  50.       WINDOW
  51.       READ
  52.       finder=!(left(mname,3)+left(mfname,1))
  53. *     LAST &finder       ;in VP-Info only
  54.       FIND &finder
  55.       IF #=0
  56.          finder=finder+'01'
  57.       ELSE
  58.          LIMIT 4         ;this and following 2 commands not required in
  59.          GOTO bottom     ;  VP-Info when LAST is used instead of FIND
  60.          LIMIT
  61.          num=val(right(solicitor,2))
  62.          IF num<99
  63.             finder=finder+right(str(101+num,3),2)
  64.          ELSE
  65.             finder='******'
  66.          ENDIF
  67.       ENDIF
  68.       GOTO recnum
  69.       REPLACE fname with mfname,name with mname,solicitor with finder
  70.       ERASE
  71.       TEXT .2
  72.       :field=field(address)
  73.    ELSE
  74.       :field=field(fname)
  75.    ENDIF
  76.    @ 0,0 say pic(#,'999,999')
  77.    @ 0,77 say iff(deleted(1),'DEL','   ')
  78.    READ
  79.    kn=:key
  80.    DO CASE kn
  81.    CASE kn=17                     ; ^Q=no update
  82.       NOUPDATE
  83.    CASE kn=329                    ; <PgUp>=Beginning of file
  84.       SKIP -1
  85.       IF #=0
  86.          GOTO top
  87.          RING
  88.       ENDIF
  89.    CASE kn=337                    ; <PgDn>=End of file
  90.       SKIP
  91.       IF eof
  92.          GOTO bottom
  93.          RING
  94.       ENDIF
  95.    CASE kn=375                    ; ^<Home>=Beginning of file
  96.       GO top
  97.    CASE kn=373                    ; ^<End>=End of file
  98.       GOTO bottom
  99.    CASE kn=374                    ; ^<PgDn>=Add a record
  100.       GOTO top
  101.       IF solicitor>' '
  102.          APPEND blank
  103.       ENDIF
  104.    CASE kn=335                    ; <End>=Quit
  105.       BREAK
  106.    ENDCASE kn
  107. ENDDO
  108. CLOSE all
  109. RETURN
  110. *
  111. *                     *** end of program soledit.prg ***
  112.