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

  1. * Program...: comm2-2.cmd
  2. * Author....: Paul V. Pullen
  3. * Date......: 4 May 1989
  4. * Notes.....: This program is used to add communion records to the
  5. *             commune database.
  6. select primary
  7. use b:commune
  8. select secondary
  9. use b:congre index b:name
  10. select primary
  11. erase
  12. store date() to mdate
  13. store ' ' to ans
  14. @ 5,5 say 'Is this date correct? ' get mdate
  15. clear gets
  16. @ 7,5 say 'Enter Y for YES, N for NO'
  17. @ 8,16 get ans picture '!'
  18. read
  19. if ans = 'N'
  20.     erase
  21.     @ 5,5 say 'Please input new date ' get mdate
  22.     read
  23. endif ans
  24. store mdate to string
  25. store $(string,7,8) to day1
  26. store $(string,1,5) to string
  27. store $(string,1,2) to day2
  28. store $(string,4,5) to day3
  29. store day1+day2+day3 to ding
  30. store val(ding) to dong
  31. release day1,day2,day3,string,ding
  32. erase
  33. store 'Initial entry  ' to mname
  34. store t to addcom
  35. erase
  36. do while addcom
  37.  store '                    ' to mlast
  38.  @ 22,1 SAY 'Last person stored was '+mname
  39.  @ 20,1 say 'Enter Last Name of Person receiving Communion ' get mlast
  40.  read noupdate
  41.  if mlast = '            '
  42.   store f to addcom
  43.   select secondary
  44.   use
  45.   select primary 
  46.   release mfirst,mlast,tem,length,findmem,placemark,mcom,mid,mname,contin22
  47.   release mdate
  48.   loop
  49.  endif mlast = '   '
  50.  store $(mlast,1,1) to tem
  51.  store !(tem) to tem
  52.  store len(trim(mlast)) to length
  53.  store $(mlast,2,length) to findmem
  54.  store tem+findmem to findmem
  55.  select secondary
  56. find &findmem
  57.  store # to placemark
  58.  if # = 0
  59.   @ 20,0 say  findmem+' IS NOT in the database'
  60.   @ 21,0 say 'If this is a visitor type a Y for visitor, any other letter'
  61.   @ 22,0 say 'returns for another entry'
  62.   wait to contin22
  63.   if !(contin22) # 'Y'
  64.    @ 20,0 say '                                                             '
  65.    @ 21,0 say '                                                             '
  66.    @ 22,0 say '                                                             '
  67.    @ 23,0 say '                               '
  68.    loop
  69.   else
  70.    store 'Guest' to findmem
  71.    find &findmem
  72.     @ 20,0 say '                                                            ' 
  73.     @ 21,0 say '                                                            '
  74.     @ 22,0 say '                                                            '
  75.     @ 23,0 say '                              '
  76.   endif !(contin22)
  77.  endif #=0
  78.  erase
  79.  if findmem = 'Guest'
  80.    store # to placemark
  81.  else
  82.    skip
  83.   iF  eof 
  84.    skip -1
  85.    store # to placemark 
  86.   eLSE
  87.    IF last:name = findmem 
  88.     skip -1
  89.     store t to next
  90.     @ 1,5 say 'The following records are matches to '+findmem
  91.     disp last:name,first:name,address
  92.     skip
  93.     do while next
  94.     if last:name = findmem .and. .not. eof
  95.      disp last:name, first:name, address
  96.      skip
  97.     else
  98.      store f to next
  99.     endif last:name=findmem
  100.     enddo while next
  101.     @ 22,10 say 'Enter Number from LEFT COLUMN to record - 0 to ABORT'
  102.     input ' ' to placemark
  103.    ELSE
  104.     skip -1
  105.     store # to placemark
  106.    ENDIF last:name=findmem
  107.   eNDIF last:name = findmem .and. eof
  108.  endif findmem = 'Guest'
  109.   if placemark > 0
  110.     go placemark
  111.     store commune to mcom
  112.     store mcom+1 to mcom
  113.     store memid to mid
  114.     store first:name to mname
  115.     store $(mname,1,1) to mname
  116.     store mname+':'+findmem to mname
  117.     replace s.last:atten with dong
  118.     replace commune with mcom
  119.     select primary
  120.     appe blank
  121.     replace memid with mid, date with mdate
  122.     erase
  123.   endif for valid record number
  124. erase
  125. endif for case where we found the record
  126.  
  127. enddo
  128. release addcom
  129. return
  130. * EOF.comm2-2.CMD
  131.