home *** CD-ROM | disk | FTP | other *** search
/ Oakland CPM Archive / oakcpm.iso / cpm / dbaseii / comm.lbr / COMM2-3.CZD / COMM2-3.CMD
Encoding:
Text File  |  1990-04-02  |  5.6 KB  |  195 lines

  1. * Program..: comm2-3.cmd
  2. * Author...: P. V. Pullen
  3. * Date.....: July 1, 1989
  4. * Notes....: This program is used to add members to the Congre data base
  5. *            for use in the Donate and Commune Databases
  6. erase
  7. select primary
  8. use b:congre index b:name
  9. store t to contin23
  10. do while contin23
  11. store ' ' to choice
  12. @ 5,5 say '***********************************'
  13. @ 5,40 say '*********************************'
  14. @ 6,5 say '*'
  15. @ 6,72 say '*'
  16. @ 7,5 say '*'
  17. @ 7,72 say '*'
  18. @ 8,5 say '*'
  19. @ 8,72 say '*'
  20. @ 9,5 say '*'
  21. @ 9,72 say '*'
  22. @ 10,5 say '*'
  23. @ 10,72 say '*'
  24. @ 11,5 say '*'
  25. @ 11,72 say '*'
  26. @ 12,5 say '*'
  27. @ 12,72 say '*'
  28. @ 13,5 say '*'
  29. @ 13,72 say '*'
  30. @ 14,5 say '*'
  31. @ 14,72 say '*'
  32. @ 15,5 say '**********************************'
  33. @ 15,40 say '*********************************'
  34. @ 15,33 say ' Select : : '
  35. @ 15,42 get choice picture '#'
  36. @ 7,25 say '0. Return to previous menu'
  37. @ 9,25 say '1. Add a member to the system'
  38. @ 11,25 say '2. Delete a Member`s total records'
  39. read noupdate
  40. do case
  41.  case choice = '0'
  42.    store f to contin23
  43.    release mfirst, mlast,madd,mcity,mstat,menv,mdonat,mcommune,midno
  44.    loop
  45. case choice='1'
  46.    erase
  47.    SElect primary
  48.    store t to addmem
  49.    do while addmem
  50.      store '                    ' to mfirst
  51.      store '                    ' to mlast
  52.      store '                         ' to madd
  53.      store 'Baltimore       ' to mcity
  54.      store '  ' to mstat
  55.      store '     'to mzip
  56.      store 0 to menv
  57.      store 0.00 to mdonat
  58.      store 0 to mcommune
  59.      store 0 to midno
  60.      erase
  61.      @ 5,5 say 'Input the new member`s last name ' get mlast
  62.      read noupdate
  63.      if mlast = '     '
  64.        store f to addmem
  65.        release mlast,mfirst,madd,mcity,mstat,mzip,menv,mdonat,mcommune,;
  66.                midno,tem,length,oktoadd,trimname
  67.        erase
  68.   select primary
  69.   @ 4,5 say 'I am re-indexing the Congre database on name '
  70.   index on last:name to b:name
  71.   @ 4,5 say 'I am re-indexing the Congre database on Envelope Number'
  72.   index on env:no to b:cenv
  73.   select secondary
  74.   use
  75.   erase
  76.   @ 4,5 say 'Thank you for your patience.  I am finished, and will return to'
  77.   @ 5,5 say 'the menu.   '
  78.   store 0 to icount
  79.   do while icount<100
  80.     store icount+1 to icount
  81.   enddo
  82.   erase
  83.         select secondary
  84.        use
  85.        select primary
  86.        loop
  87.      else
  88.        store $(mlast,1,1) to tem
  89.        store len(mlast) to length
  90.        store $(mlast,2,length) to mlast
  91.        store !(tem)+mlast to mlast
  92.      endif mlast = '     '
  93.      store (trim(mlast)) to trimname
  94.      find &trimname
  95.      store f to oktoadd
  96.      if # > 0
  97.        erase
  98.        @ 1,1 say 'Records which match the new name:'
  99.        disp off last:name first:name while last:name = trimname
  100.        input 'Add the name anyway (Y/N)? ' to oktoadd
  101.      endif #>0
  102.      if # = 0 .or. oktoadd
  103.        select secondary
  104.        use b:iddata
  105.        go top
  106.        store in:number to nmemid
  107.        store nmemid to midno
  108.        store nmemid+1 to nmemid
  109.        replace in:number with nmemid
  110.        SELECT SECONDARY
  111.        USE
  112.        Select primary
  113.        appe blank
  114.        set format to comm2-3
  115.        read noupdate
  116.        store $(mfirst,1,1) to tem
  117.        store len(mfirst) to length
  118.        store $(mfirst,2,length) to mfirst
  119.        store !(tem)+mfirst to mfirst
  120.        replace last:name with mlast,first:name with mfirst,address with;
  121.          madd,state with mstat, zip with mzip, env:no with menv, donations;
  122.          with mdonat, commune with mcommune, memid with midno, city with mcity
  123.        set format to screen
  124.      endif # = 0
  125.    enddo
  126.   case choice ='2'
  127.     erase
  128.     select primary
  129.     store t to delmem
  130.     do while delmem
  131.      store '                    ' to mlast
  132.      erase
  133.      @ 5,5 say 'Input the member`s last name for data delete ' get mlast
  134.      read noupdate
  135.      if mlast = '     '
  136.        store f to delmem
  137.        release mlast,mfirst,madd,mcity,mstat,mzip,menv,mdonat,mcommune,midno
  138.        release tem,length,trimname,placemark,oktodel
  139.        select primary
  140.        loop
  141.      else
  142.        store $(mlast,1,1) to tem
  143.        store len(mlast) to length
  144.        store $(mlast,2,length) to mlast
  145.        store !(tem)+mlast to mlast
  146.      endif mlast = '     '
  147.      store (trim(mlast)) to trimname
  148.      find &trimname
  149.      store f to oktodel
  150.      if # > 0
  151.        erase
  152.        @ 1,1 say 'Records which match the new name:'
  153.        disp last:name first:name while last:name = trimname
  154.        @ 20,1 say ' '
  155.        input 'Enter record number to edit, 0 to abort ? ' to placemark
  156.      else
  157.        @ 20,8 say 'Last Name '+mlast+' not found'
  158.        wait
  159.        loop
  160.      endif #>0
  161.      if placemark > 0
  162.        go placemark
  163.        erase
  164.        @ 8,10 say 'First Name : '+first:name
  165.        @ 9,10 say 'Last Name  : '+last:name
  166.        @ 10,10 say 'Address    : '+ADDRESS
  167.        @ 11,10 say 'City       : '+city
  168.        @ 12,10 say 'State      : '+state
  169.        @ 20,5 say 'Should I delete this member?  Y or T to delete ' get oktodel
  170.        read noupdate
  171.        if oktodel
  172.          @ 21,20 say 'Okay, I will delete this member'
  173.          store env:no to menv
  174.          store memid to midno
  175.          delete
  176. *        select secondary
  177. *        use b:donate
  178. *        delete all for env:no = menv
  179. *        select secondary
  180. *        use b:commune
  181. *        delete all for memid = midno
  182.          wait
  183.          select secondary
  184.          use
  185.          select primary
  186.        endif oktodel
  187.    endif # = 0
  188.    erase
  189.  enddo
  190. endcase
  191. enddo
  192. release choice,oktoadd,oktodel,delmem,addmem,edmem,contin23
  193. return
  194. * eof comm2-3.Cmd
  195.