home *** CD-ROM | disk | FTP | other *** search
/ Shareware Overload / ShartewareOverload.cdr / database / chrchpr4.zip / MSSATTND.CMD < prev    next >
OS/2 REXX Batch file  |  1987-01-06  |  3KB  |  116 lines

  1. * Program MSSATTND - Marks SSSCATTD field with this week's attendance
  2. Set bell off
  3. Select primary
  4. Store curwk-1 to curwk1
  5. Store curwk+1 to curwk2
  6. Store 59-curwk to curwk3
  7. Store curwk-3 to curwk4
  8. Store curwk-5 to curwk5
  9. Do while (* .or. &BNAME) .and. .not. EOF
  10.   SKIP
  11. enddo
  12. sTORE 0 TO ATTCOUNT
  13. Do while .not. EOF .and. &ANAME=ANAME1
  14.   Erase
  15.   @ 1,10 say 'Attendance Marking for '+actvname+'       Week '+weekname
  16.   Store 2 to LINECNTR
  17.   Do while LINECNTR<22 .and. &ANAME=ANAME1 .and. .not. EOF
  18.     Store linecntr+1 to linecntr
  19.     Store $(ssscattd,curwk,1) to NMC
  20.     Store $(membstatus,7,1) to N1
  21.     Store $(membstatus,8,1) to N2
  22.     If N2='X'
  23.       Store ' ' to N2
  24.       Replace membstatus with $(membstatus,1,7)+' '+$(membstatus,9,2)
  25.     endif
  26.     Store ' ' to NMCX
  27.     If NMC<>' '
  28.       Store 'X' to NMCX
  29.     endif
  30.     @ linecntr,1 say N1+N2
  31.     @ linecntr,4 say $(ssscattd,curwk5,5)
  32.     @ linecntr,11 get NMC
  33.     @ linecntr,16 say last:name+first:name+home:phone
  34.     READ
  35.     Do case
  36.     CASE !(NMC)='Q'
  37.       goto top
  38.       RETURN
  39.     CASE NMC='!'
  40.       Store $(membstatus,8,1) to N2
  41.       Store trim(last:name)+', '+trim(first:name) to tname
  42.       If len(tname)>21
  43.         Store $(tname,1,21) to tname
  44.       endif
  45.       @ linecntr,1 say XX+XX
  46.       @ linecntr,1 say 'New Counter' get N1
  47.       @ linecntr,17 say 'Active Status' get N2
  48.       @ linecntr,36 say "Today's Attendance" get NMC
  49.       @ linecntr,58 say tname
  50.       READ
  51.       If N1<>$(membstatus,7,1) .or. N2<>$(membstatus,8,1)
  52.         Replace membstatus with $(membstatus,1,6)+N1+N2+$(membstatus,9,2)
  53.       endif
  54.     CASE NMC<>' '
  55.       Store 'X' to NMC
  56.     otherwise
  57.     endcase
  58.     If N1='I'
  59.      If !(N2)<>'A'
  60.       Replace membstatus with $(membstatus,1,6)+' *'+$(membstatus,9,2)
  61.       Replace ss:sc:memb with $(ss:sc:memb,1,4)+'*'
  62.       Store  '*' to N2
  63.      else
  64.       Replace membstatus with $(membstatus,1,6)+' A'+$(membstatus,9,2)
  65.      endif
  66.    endif
  67.    If NMC=' '
  68.      If $(ssscattd,curwk4,2)='  '
  69.        If N2=' '
  70.          Replace membstatus with $(membstatus,1,6)+'I '+$(membstatus,9,2)
  71.        else
  72.          if N2='N'
  73.            Replace membstatus with $(membstatus,1,1)+'*'+$(membstatus,4,2)+' *'
  74.          endif
  75.        endif
  76.      endif
  77.    else
  78.      STORE ATTCOUNT+1 TO ATTCOUNT
  79.      If N2='N'
  80.       Store curwk5 to N
  81.       Store 0 to attdcnt
  82.       Do while N<curwk
  83.         If $(ssscattd,N,1)='X'
  84.           Store attdcnt+1 to attdcnt
  85.         endif
  86.         Store N+1 to N
  87.       enddo
  88.       If attdcnt>1
  89.        Replace membstatus with $(membstatus,1,6)+' X'+$(membstatus,9,2)
  90.       else
  91.        Store val($(membstatus,7,1))+1 to NMCNT
  92.        Replace membstatus with $(membstatus,1,6)+str(NMCNT,1)+$(membstatus,8,3)
  93.       endif
  94.     endif
  95.    endif
  96.     If NMC<>NMCX
  97.      Replace SSSCATTD with $(SSSCATTD,1,curwk1)+NMC+$(ssscattd,curwk2,curwk3)
  98.     endif
  99.     SKIP
  100.     Do while (* .or. &BNAME) .and. .not. EOF
  101.       SKIP
  102.     enddo
  103.   enddo
  104.   If .not. (EOF .or. &ANAME<>ANAME1)
  105.     Accept ' Press <retn> to advance to next screen of names.' to XX
  106.   endif
  107. enddo
  108. Release NMC,LC,LINECNTR,LINX,curtop,curbotm,curwk1,curwk2,ins,curweek,nmcnt
  109. Release curdatey,attdcnt,curwk3,curwk4,curwk5,nmcx,n1,n2,n,tname
  110. ? '    Attendance marking is complete. Total marked present = ',str(attcount,4)
  111. ?
  112. Release attcount
  113. Accept ' Press <retn> to exit.' to XX
  114. Set bell on
  115. Return
  116.