home *** CD-ROM | disk | FTP | other *** search
/ ftp.barnyard.co.uk / 2015.02.ftp.barnyard.co.uk.tar / ftp.barnyard.co.uk / cpm / walnut-creek-CDROM / CPM / DATABASE / KPHANDYP.LBR / PLANNING.CZD / PLANNING.CMD
OS/2 REXX Batch file  |  2000-06-30  |  5KB  |  243 lines

  1. ERAS
  2. USE planning index planning
  3. STOR ' ' to option
  4. STOR '                                                                      ' to space
  5. STOR '----------------------------------------------------------------------' to star
  6. STOR 1 to row
  7. SET intensity off
  8. @ 18,26 say 'Enter one of the following single letter commands:'
  9. SET intensity on
  10. @ 19,26 say 'A)dd  E)dit  F)uture  N)ext  P)ast  R)eturn  Q)uit'
  11. STOR date() to today
  12. IF today=holddate
  13. STOR val($(today,4,2)) to blink
  14. ENDI
  15. STOR $(today,1,2) to month
  16. STOR $(today,7,2) to year
  17. STOR month+'/01/'+year to today
  18. STOR 'T' to planning
  19. DO WHIL planning='T'
  20. IF !(option)#'A'
  21. STOR 0 to col
  22. STOR 0 to add
  23. SET date to &today
  24. DO saytoday
  25. DO CASE
  26. CASE factor=1
  27. STOR 15 to col
  28. CASE factor=2
  29. STOR 25 to col
  30. CASE factor=3
  31. STOR 35 to col
  32. CASE factor=4
  33. STOR 45 to col
  34. CASE factor=5
  35. STOR 55 to col
  36. CASE factor=6
  37. STOR 65 to col
  38. CASE factor=0
  39. STOR 75 to col
  40. ENDC
  41. STOR col-10 to add
  42. STOR title+', 19'+year to title
  43. SET intensity off
  44. @ 0,(80-len(title))/2 say title
  45. SET intensity on
  46. @ 1,5 say '-------SUN-------MON-------TUE-------WED-------THU-------FRI-------SAT'
  47. DO CASE
  48. CASE val(month)=2 .and. int(val(year)/4)*4=val(year)
  49. STOR 29 to endday
  50. CASE val(month)=2
  51. STOR 28 to endday
  52. CASE val(month)=9 .or. val(month)=4 .or. val(month)=6 .or. val(month)=11
  53. STOR 30 to endday
  54. otherwise
  55. STOR 31 to endday
  56. ENDC
  57. STOR 1 to day
  58. STOR 3 to row
  59. STOR col-10 to col
  60. DO WHIL day<endday+1
  61. IF day=blink
  62. SET intensity off
  63. @ row,col-1 say chr(27)+chr(66)+chr(50)
  64. ENDI
  65. @ row,col say day
  66. IF day=blink
  67. SET intensity on
  68. @ row,col+1 say chr(27)+chr(67)+chr(50)
  69. ENDI
  70. STOR day+1 to day
  71. STOR col+10 to col
  72. IF col>65
  73. STOR row+3 to row
  74. STOR 5 to col
  75. ENDI
  76. ENDD
  77. ENDI
  78. GOTO top
  79. FIND &month
  80. DO WHIL $(act:date,1,2)=month .and. .not. eof
  81. STOR add to col
  82. STOR 4 to row
  83. STOR 1 to day
  84. STOR $(act:date,4,2) to start
  85. STOR trim(act:desc) to desc
  86. DO WHIL day<val(start)
  87. STOR day+1 to day
  88. STOR col+10 to col
  89. IF col>65
  90. STOR row+3 to row
  91. STOR 5 to col
  92. ENDI
  93. ENDD
  94. SET intensity off
  95. STOR ' ' to line2
  96. IF len(desc)+col>75
  97. STOR $(desc,1,75-col) to line1
  98. STOR line2+$(desc,75-col+1,len(desc)-(75-col)) to line2
  99. ELSE
  100. STOR desc to line1
  101. ENDI
  102. IF $(act:date,7,2)=year
  103. @ row,col say line1
  104. IF row+3<19
  105. @ row+3,add-1 say line2
  106. ENDI
  107. ENDI
  108. SKIP
  109. ENDD
  110. STOR ' ' to option
  111. SET intensity off
  112. @ 22,26 say 'WAITING';
  113. get option
  114. READ
  115. SET intensity on
  116. DO CASE
  117. CASE !(option)='Q'
  118. STOR 'F' to planning
  119. CASE !(option)='A'
  120. STOR '  ' to start
  121. STOR ' ' to length
  122. @ 22,0
  123. SET intensity off
  124. @ 22,6 say 'Starting day of activity (DD)';
  125. get start
  126. @ 22,40 say 'Length of activity in days';
  127. get length
  128. READ
  129. SET intensity on
  130. STOR 10*val(length) to width
  131. STOR $(space,1,width) to desc
  132. @ 22,18
  133. @ 22,0 say 'Activity';
  134. get desc
  135. READ
  136. STOR trim(desc)+' '+$(star,1,width-len(trim(desc))-2)+'>' to desc
  137. STOR add to col
  138. STOR 4 to row
  139. STOR 1 to day
  140. DO WHIL day<val(start)
  141. STOR day+1 to day
  142. STOR col+10 to col
  143. IF col>65
  144. STOR row+3 to row
  145. STOR 5 to col
  146. ENDI
  147. ENDD
  148. SET intensity off
  149. STOR ' ' to line2
  150. IF len(desc)+col>75
  151. STOR $(desc,1,75-col) to line1
  152. STOR line2+$(desc,75-col+1,len(desc)-(75-col)) to line2
  153. ELSE
  154. STOR desc to line1
  155. ENDI
  156. @ row,col say line1
  157. IF row+3<19
  158. @ row+3,add-1 say line2
  159. ENDI
  160. SET intensity on 
  161. @ 22,0
  162. IF len(month)<2
  163. STOR '0'+month to month
  164. ENDI
  165. IF len(trim(start))<2
  166. STOR '0'+trim(start) to start
  167. ENDI
  168. STOR $(month,1,2)+'/'+start+'/'+year to start
  169. GOTO bottom
  170. APPE BLAN
  171. REPL act:date with start,act:desc with desc
  172. CASE !(option)='E'
  173. GOTO top
  174. BROW
  175. PACK
  176. STOR month+'/01/'+year to now
  177. SET date to &now
  178. DO planning
  179. CASE !(option)='F' .or. !(option)='P'
  180. STOR '     ' to new
  181. @ 22,0
  182. SET intensity off
  183. @ 22,26 say 'Enter month and year (MM/YY)';
  184. get new picture 'XX/XX'
  185. READ
  186. SET intensity on
  187. STOR trim(new) to new
  188. STOR $(new,1,2) to month
  189. STOR $(new,4,2) to year
  190. STOR month+'/01/'+year to today
  191. @ 22,0
  192. STOR 0 to row
  193. DO WHIL row<17
  194. @ row,0
  195. STOR row+1 to row
  196. ENDD
  197. IF factor=0 .and. endday>29
  198. @ 18,13 say '            '
  199. @ 19,13 say '            '
  200. ENDI
  201. IF $(holddate,1,3)+'01'+$(holddate,6,3)=today
  202. STOR val($(holddate,4,2)) to blink
  203. ELSE
  204. STOR 0 to blink
  205. ENDI
  206. CASE !(option)='N'
  207. DO nextdate
  208. @ 22,0
  209. STOR 0 to row
  210. DO WHIL row<17
  211. @ row,0
  212. STOR row+1 to row
  213. ENDD
  214. IF factor=0 .and. endday>29
  215. @ 18,13 say '            '
  216. @ 19,13 say '            '
  217. ENDI
  218. STOR 0 to blink
  219. CASE !(option)='R'
  220. STOR $(holddate,1,2)+'/01/'+$(holddate,7,2) to today
  221. STOR val($(holddate,4,2)) to blink
  222. @ 22,0
  223. STOR 0 to row
  224. DO WHIL row<17
  225. @ row,0
  226. STOR row+1 to row
  227. ENDD
  228. IF factor=0 .and. endday>29
  229. @ 18,13 say '            '
  230. @ 19,13 say '            '
  231. ENDI
  232. ENDC
  233. ENDD
  234. SET date to &holddate
  235. RETU
  236. ctor=0 .and. endday>29
  237. @ 18,13 say '            '
  238. @ 19,13 say '            '
  239. ENDI
  240. ENDC
  241. ENDD
  242. SET date to &holddate
  243. R