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

  1. * Program MATTDATE - Gets a user week number associated with year's date
  2. Select secondary
  3. GOTO 5
  4. Store    '  1     2     3     4     5     6     7   ' to Q1
  5. Store Q1+'  8     9     10    11    12    13    14  ' to Q1
  6. Store    '  14    15    16    17    18    19    20    21  ' to Q2
  7. Store Q2+'  22    23    24    25    26    27    28    29  ' to Q2
  8. Store    '  27    28    29    30    31    32    33    34  ' to Q3
  9. Store Q3+'  35    36    37    38    39    40    41    42  ' to Q3
  10. Store    '  40    41    42    43    44    45    46    47  ' to Q4
  11. Store Q4+'  48    49    50    51    52    53    54  ' to Q4
  12. Store 1 to qtrcntr
  13. Store 1 to PWK
  14. Store 0 to wkcnt
  15. Store 0 to wkcntr
  16. ?
  17. ? 'Select a week number belonging to one of the following weekly dates -'
  18. ?
  19. Do while QTRCNTR < 5
  20.  Store str(qtrcntr,1) to Q
  21.  Store 0 to wkcntr
  22. If $(spact,28,2)='  '
  23.   Store $(spact,3,24) to curdat&Q
  24.   Store wkcntr+4 to wkcntr
  25. else
  26.   Store $(SPACT,3,29)+' ' to curdat&Q
  27.   Store wkcntr+5 to wkcntr
  28. endif
  29. SKIP
  30.   If $(spact,28,2)='  '
  31.     Store curdat&Q+$(spact,3,24) to curdat&Q
  32.     Store wkcntr+4 to wkcntr
  33.   else
  34.     Store curdat&Q+$(spact,3,29)+' ' to curdat&Q
  35.     Store wkcntr+5 to wkcntr
  36.   endif
  37.   SKIP
  38.   If $(spact,28,2)='  '
  39.     Store curdat&Q+$(spact,3,24) to curdat&Q
  40.     Store wkcntr+4 to wkcntr
  41.   else
  42.     Store curdat&Q+$(spact,3,29)+' ' to curdat&Q
  43.     Store wkcntr+5 to wkcntr
  44.   endif
  45. SKIP
  46. If wkcntr<14
  47.   ? $(Q&Q,pwk*6-5,wkcntr*6)
  48. else
  49.   ? $(Q&Q,pwk*6-5,76),$(Q&Q,pwk*6+75,2)
  50. endif
  51. Store pwk to pwk&Q
  52. Store pwk+wkcntr-13 to pwk
  53. Store wkcnt+wkcntr to wkcnt
  54. Store wkcnt+1 to wkcnt&Q
  55. If wkcntr<14
  56.   ? curdat&Q
  57. else
  58.   ?? curdat&Q
  59. endif
  60. ?
  61. Store 0 to wkcntr
  62. Store qtrcntr+1 to qtrcntr
  63. enddo
  64. Select primary
  65. Accept 'Enter week number ' to curweek
  66. Store len(curweek) to N
  67. If $(curweek,N,1)='-' .and. curweek<>'-'
  68.   Store $(curweek,1,N-1) to curweek
  69.   Accept 'Enter a starting last name ' to LNAME
  70.   ? 'Now searching for',lname
  71.   If FCATTD
  72.     find &LNAME
  73.   endif
  74.   Do while (* .or. last:name<>lname .or. &bname) .and. .not. EOF
  75.     SKIP
  76.   enddo
  77.   If last:name<>lname
  78.      Accept 'No names found with this name. Press <retn> ' to XX
  79.      RETURN
  80.   endif
  81. endif
  82. Store '                                        ' to XX
  83. Store val(curweek) to curwk
  84. Do while (curwk<1) .or. (curwk>wkcnt)
  85.   If !(curweek)='Q'
  86.     STORE T TO VALID3
  87.     Return
  88.   endif
  89.   Accept 'Invalid week number. Please enter again ' to curweek
  90.   Store val(curweek) to curwk
  91. enddo
  92. Store 0 to qtrcntr
  93. Do while qtrcntr<5
  94.   Store qtrcntr+1 to qtrcntr
  95.   Store str(qtrcntr,1) to Q
  96.   If curwk<wkcnt&Q
  97.     Store $(curdat&Q,(pwk&Q+curwk+12-qtrcntr*13)*6-5,6) to weekname
  98.     Store 5 to qtrcntr
  99.   endif
  100. enddo
  101. Store curweek+' - '+weekname to weekname
  102. Release Q1,Q2,Q3,Q4,CURDAT1,CURDAT2,CURDAT3,CURDAT4,qtrcntr,pwk,wkcntr,wkcnt,Q
  103. Release lname,pwk1,pwk2,pwk3,pwk4,wkcnt1,wkcnt2,wkcnt3,wkcnt4,curweek,N
  104. STORE CURWK TO curwk5
  105. Store curwk+5 to curwk
  106. return
  107.  
  108.  
  109.  
  110. ame
  111.   Store F to match
  112.   If FCATTD
  113.     find &LNAME
  114.   endif
  115.   Do while (