home *** CD-ROM | disk | FTP | other *** search
/ The Datafile PD-CD 2 / DATAFILE_PDCD2.iso / utilities2 / _diary / !Diary / !RunImage (.txt) < prev    next >
RISC OS BBC BASIC V Source  |  1993-08-27  |  12KB  |  608 lines

  1.  >!RunImage
  2.  For NSW's Diary
  3.  26/08/93
  4. >I$="1.27 (26th August 1993)":
  5. $+" at line "+
  6. w:p$=
  7. p$<>""
  8. p(p$):
  9. $+" at line "+
  10. &400C7,,d%
  11. &400C8,,d%
  12. &400C5,,d%
  13. &400C6,,d%
  14. 17,18:
  15. &400DD:
  16. C:a$()="":b$()="":a%()=0:$D%="DiaryFile":$I%="ToDoToday":
  17. e% 512,R% 256,ba% 20,ca% 512,da% 256,d% 256,ea% 512,D% 256,fa% 512,I% 256,ga% 1024,ha% 512,J% 124,r% 1024,S% 256,T% 13,ia% 30:
  18. a$(350),b$(4),a%(35),b%(4)
  19. $ia%="1234567890/":o%=0:$ba%="Error From Diary":G%=
  20. :s%=0:U%=0:V%=0:
  21. &400C0,200,&4B534154,"Diary"
  22. ja%:l%=
  23. "<Diary$Dir>.Sprites":L%=
  24. #l%+16:
  25. t% L%:!t%=L%-1:t%!4=0:t%!8=16:t%!12=16
  26. &2E,256+10,t%,"<Diary$Dir>.Sprites":j%=
  27. i(-1,0,0,68,68,12298,"!diary"):
  28. &400D9,,"<Diary$Dir>.Templates":ka%=
  29. d(ca%,da%,255,"info",t%):p%=
  30. d(ea%,D%,255,"save",t%):v%=
  31. d(fa%,I%,255,"save",t%):h%=
  32. d(ga%,ha%,511,"main",t%):
  33. &400DA
  34. ^$(da%+99)=I$:$D%="DiaryFile":$I%="ToDoToday":$(I%+112)="sfile_fff":$(D%+112)="sfile_0e1":
  35. w:a%=J%:$a%="Diary":a%!12=459271:a%!16=160:a%!20=44:a%!24=0:
  36. b(a%+28,0,ka%,&7091031,"Info"):
  37. b(a%+52,0,-1,&7091031,"New File"):
  38. b(a%+76,0,r%+700,&7091031,"Save"):
  39. b(a%+100,128,-1,&7091031,"Quit")
  40. &400D4,,J%
  41. &400D4,,-1:a%=r%:$a%="Diary":a%!12=459271:a%!16=160:a%!20=44:a%!24=0:
  42. b(a%+28,0,a%+200,&7091031,"Repeat"):
  43. b(a%+52,0,a%+400,&7091031,"Goto"):
  44. b(a%+76,2,a%+600,&7091031,"Edit")
  45. b(a%+100,2,ka%,&7091031,"Info"):
  46. b(a%+124,0,r%+700,&7091031,"Save"):
  47. b(a%+148,128,-1,&7091031,"Quit"):a%=r%+200:$a%="Repeat":a%!12=459271:a%!16=16*14:a%!20=44:a%!24=0:
  48. b(a%+28,0,-1,&7091031,"Daily"):
  49. b(a%+52,0,-1,&7091031,"Weekly")
  50. b(a%+76,0,-1,&7091031,"Monthly"):
  51. b(a%+100,0,-1,&7091031,"Yearly"):
  52. b(a%+124,0,-1,&7091031,"Incrementing"):
  53. b(a%+148,128,-1,&7091031,"Off"):a%=r%+400:$a%="(dd/mm/yy)":a%!12=459271:a%!16=16*11:a%!20=44:a%!24=0
  54. a%!28=4:a%!32=-1:a%!36=&700F101:a%!40=T%:a%!44=ia%:a%!48=11:
  55. b(a%+52,0,-1,&7091031,"Today"):
  56. b(a%+76,0,-1,&7091031,"Find prev"):
  57. b(a%+100,128,-1,&7091031,"Find next"):a%=r%+600
  58. $a%="Edit":a%!12=459271:a%!16=16*12:a%!20=44:a%!24=0:
  59. b(a%+28,0,-1,&7091031,"Delete line"):
  60. b(a%+52,128,-1,&7091031,"Clear today"):a%=r%+700:$a%="Save":a%!12=459271:a%!16=16*14:a%!20=44:a%!24=0
  61. b(a%+28,0,p%,&7091031,"Whole file"):
  62. b(a%+52,128,v%,&7091031,"Today only"):
  63. x:x%=!d%:y%=d%!4:E%=d%!8:m%=d%!12:j%=d%!16:
  64. 2:u%=p%:
  65. 2:u%=v%:
  66. s(x%,y%,
  67. :q%=(j%-4):
  68. s(x%,y%,
  69. 16,64:
  70. p%:F$="file_0e1"
  71. v%:F$="file_fff"
  72. F:u%=m%
  73. ;'s%-=1:a$=a$(a%(s%)):
  74. a$,14,1)="I"
  75. <Lg%=
  76. a$,"%Y"):
  77. a$,g%-1)+
  78. b(h%,9),14,2)-
  79. a$,11,2))+
  80. a$,g%+2)
  81. a$,16):
  82. c(h%,19,a$):
  83. s%=35
  84. s%=n%-1
  85. @'s%+=1:a$=a$(a%(s%)):
  86. a$,14,1)="I"
  87. ALg%=
  88. a$,"%Y"):
  89. a$,g%-1)+
  90. b(h%,9),14,2)-
  91. a$,11,2))+
  92. a$,g%+2)
  93. a$,16):
  94. c(h%,19,a$):
  95. F:x%=!d%:y%=d%!4:d%!4=5:d%!8=x%-76:d%!16=x%+76:d%!12=y%-52:d%!20=y%+52:d%!24=0:d%!32=&7FFFFFFF:d%!28=0:d%!36=&7FFFFFFF:
  96. 6,161,28
  97. ,,f%:
  98. ja%>=310
  99. &42400,197,1,F$,d%+8,d%+24
  100. &400D0,,d%
  101. z:j%=d%!4:z%=d%!24:
  102. &400DC,z%
  103. N    u%=p%
  104. &400DC,z%
  105. S    u%=v%
  106. h%:i%=
  107. ):i%=
  108. n(p%):i%=
  109. ):i%=
  110. ):i%=
  111. &400DC,z%
  112. &400DC,z%
  113. G:A%=
  114. :c%=0:
  115. :c%+=1:
  116. 8:A%=
  117. b(h%,j%))>0:
  118. c%=365:
  119. c%=365B%=
  120. a("er3"))
  121. H:A%=
  122. :c%=0:
  123. :c%+=1:
  124. 8:A%=
  125. b(h%,j%))>0:
  126. c%=365:
  127. c%=365B%=
  128. a("er3"))
  129. f:j$=
  130. f("Sys$Date")+" "+
  131. f("Sys$Year"):
  132. c(h%,9,j$):
  133. t(t$):
  134. t$=""
  135. a("er2")):
  136. gQg%=0:la%=0:
  137. t$,"/",g%)>0:g%=
  138. t$,"/",g%)+1:la%+=1:
  139. :s$="":r$="":q$="":
  140. 0:s$=
  141. t$,2)
  142. 1:s$=
  143. t$,2):r$=
  144. t$,"/",0)+1,2)
  145. 2:s$=
  146. t$,2):g%=0:g%=
  147. t$,"/",g%)+1:r$=
  148. t$,g%,2):g%=
  149. t$,"/",g%)+1:q$=
  150. t$,g%,4)
  151. s$,"/",0)>0
  152. s$,"/",0)-1)
  153. r$,"/",0)>0
  154. r$,"/",0)-1)
  155. q$,"/",0)>0
  156. q$,"/",0)-1)
  157. s$=1s$="0"+s$
  158. r$=1r$="0"+r$
  159. "1992",4-
  160. q$)+q$
  161. D$=c$(
  162. r$-1,0):
  163. r$<=2
  164. sBma%=365*
  165. s$+31*(
  166. r$-1)+((
  167. q$-1)
  168. (3/4*
  169. q$-1)
  170. 100)+1)
  171. :ma%=365*
  172. s$+31*(
  173. r$-1)-
  174. (0.4*
  175. r$+2.3)+
  176. q$/4)-
  177. (3/4*(
  178. 100)+1))
  179. v_m$=
  180. "Sat,Sun,Mon,Tue,Wed,Thu,Fri,",((ma%
  181. 7)*4)+1,4):j$=m$+s$+" "+D$+" "+q$:
  182. c(h%,9,j$):
  183. I:a$=
  184. b(h%,q%+4):x$=b$(q%):
  185. b$(q%)=""x$="N"
  186. a$(M%),16)=a$
  187. a$(M%),14,1)=x$:
  188. {4a$(o%)=m$+c$+"/"+b$+"/"+n$+" "+x$+" "+a$:o%+=1:
  189. 4:b$(k%)="":
  190. c(h%,k%,""):
  191. k%=10
  192. c(h%,k%,""):
  193. :b%()=-1:m$=
  194. j$,2):c$=
  195. j$,5,2):b$=
  196. j$,8,3)):n$=
  197. j$,4):k%=4:n%=0:
  198. o%:a$=a$(c%):w$=
  199. a$,2):k$=
  200. a$,3,2)
  201. }Jl$=
  202. a$,6,2):o$=
  203. a$,9,4):z$=
  204. a$,14,1):i%=
  205. :na%=
  206. k$=c$
  207. l$=b$
  208. o$=n$i%=
  209. z$="I"
  210. a$,"%Y"):a$=
  211. a$,g%-1)+
  212. a$,g%+2)
  213. m$<>w$i%=
  214. m$=w$
  215. b$<>l$i%=
  216. m$=w$
  217. b$=l$
  218. n$<>o$i%=
  219. m$=w$
  220. c$<>k$i%=
  221. b$<>l$i%=
  222. c$=k$
  223. b$<>l$i%=
  224. c$=k$
  225. b$=l$
  226. n$<>o$i%=
  227. c$=k$
  228. b$=l$
  229. n$<>o$
  230. b$<>l$i%=
  231. a%(n%)=c%:n%+=1
  232. c$=k$
  233. b$=l$
  234. n$<>o$
  235. b$=l$
  236. a%(n%)=c%:n%+=1
  237. b$+1:w%=
  238. b$,1)):
  239. c$+7>w%:
  240. k$+w%-
  241. a%(n%)=c%:n%+=1
  242. c$=k$
  243. b$=l$
  244. n$<>o$
  245. :b$(k%-4)="I"
  246. b$=l$
  247. a%(n%)=c%:n%+=1
  248. b$+1:w%=
  249. b$,1)):
  250. c$+7>w%:
  251. k$+w%-
  252. a%(n%)=c%:n%+=1
  253. a$,"%Y"):a$=
  254. a$,g%-1)+
  255. a$,g%+2)
  256. n$=o$
  257. b$=l$
  258. c$+7:
  259. c$a%(n%)=c%:n%+=1
  260. b$+1:w%=
  261. b$,1)):
  262. k$+7>w%:
  263. k$+w%-
  264. a%(n%)=c%:n%+=1
  265. i%b$(k%-4)=z$
  266. c(h%,k%,
  267. a$,16)):b%(k%-4)=c%:k%+=1
  268. k%=10
  269. c(h%,k%,b$(k%-10)):
  270.     a$=""
  271. J:s%=0:a$=a$(a%(s%)):
  272. a$,14,1)="I"
  273. a$,"%Y"):
  274. a$,g%-1)+
  275. b(h%,9),14,2)-
  276. a$,11,2))+
  277. a$,g%+2)
  278. a$,16)
  279. c(h%,19,a$):
  280. n(h%):
  281. :oa%=
  282. n%-1:
  283. a$(a%(c%+1)),3)<
  284. a$(a%(c%)),3)
  285. a%(c%),a%(c%+1)
  286. p(p$):l%=
  287. (p$):o%=0:
  288. :a$(o%)=
  289. #l%:o%+=1:
  290. c(p%,0,p$):
  291. p$,".")=0
  292. a("er1")):
  293. (p$):
  294. a$(c%)<>""
  295. #l%,a$(c%)
  296. &5,"SetType "+p$+" 0e1":$D%=p$:C%=
  297. &400D4,,-1:
  298. j$,5,2)+"/"+
  299. j$,8,3))+"/"+
  300. j$,4):
  301. p$,".")=0
  302. a("er1")):
  303. (p$):j$=
  304. b(h%,9):
  305. #l%,j$+" :":
  306. #l%,"-----------------":
  307. o%:a$=a$(c%):w$=
  308. a$,2):k$=
  309. a$,3,2):l$=
  310. a$,6,2):o$=
  311. a$,9,4):z$=
  312. a$,14,1):i%=
  313. k$=c$
  314. l$=b$
  315. o$=n$i%=
  316. m$<>w$i%=
  317. m$=w$
  318. b$<>l$i%=
  319. m$=w$
  320. b$=l$
  321. n$<>o$i%=
  322. m$=w$
  323. c$<>k$i%=
  324. b$<>l$i%=
  325. c$=k$
  326. b$<>l$i%=
  327. c$=k$
  328. b$=l$
  329. n$<>o$i%=
  330. c$=k$
  331. b$=l$
  332. n$<>o$
  333. b$<>l$i%=
  334. "Y","I":
  335. c$=k$
  336. b$=l$
  337. n$<>o$i%=
  338. i%b$(k%-4)=z$
  339. a$,16)
  340. &5,"SetType "+p$+" fff":C%=
  341. &400D4,,-1:
  342. t(J$):
  343. e(D$):
  344. 3c%=1:
  345. :K$=c$(c%-1,0):
  346. K$=D$
  347. c%),"0")+
  348. c%+=1:
  349. c%=13:="??"
  350. d:u$=
  351. b(h%,9):m$=
  352. u$,2):c$=
  353. u$,5,2):b$=
  354. u$,8,3)):n$=
  355. u$,4):
  356. 4:a$=
  357. b(h%,k%+4):
  358. a$<>""
  359. x$=b$(k%):
  360. b%(k%)=-1
  361. g(a$)
  362. x$=""x$="N"
  363. 2a$(o%)=m$+c$+"/"+b$+"/"+n$+" "+x$+" "+a$:o%+=1
  364. x$<>"I"
  365. g(a$)a$(b%(k%))=m$+c$+"/"+b$+"/"+n$+" "+x$+" "+a$
  366. g(a$):
  367. a$(M%),16)=a$
  368. d:E$=
  369. u$,3):j$=
  370. u$,5,2):y$=
  371. u$,8,3):v$=
  372. u$,4):
  373. 6:d$=d$(c%):
  374. e$=d$(c%+1)
  375. e$=d$(0)
  376. d$=E$
  377. m$=e$
  378. 11:d$=c$(c%,0):
  379. c%<11e$=c$(c%+1,0)
  380. e$=c$(0,0)
  381. )f$=c$(c%,1):
  382. d$="Feb"
  383. f$="29"
  384. d$=y$
  385. j$=f$
  386. g$=e$:h$="01"
  387. g$=y$:h$=
  388. j$+1)
  389. h$=1h$="0"+h$
  390. y$="Dec"
  391. j$="31"
  392. v$+1)
  393. i$=v$
  394. :j$=m$+","+h$+" "+g$+" "+i$:
  395. c(h%,9,j$):
  396. d:E$=
  397. u$,3):j$=
  398. u$,5,2):y$=
  399. u$,8,3):v$=
  400. u$,4):
  401. 6:e$=d$(c%):
  402. c%<6d$=d$(c%+1)
  403. d$=d$(0)
  404. d$=E$
  405. m$=e$
  406. 11:e$=c$(c%,0):
  407. c%<11d$=c$(c%+1,0)
  408. d$=c$(0,0)
  409. "f$=c$(c%,1):
  410. e$="Feb"
  411. 100=0
  412. 400=0:f$="29"
  413. 100=0
  414. 400<>0:f$="28"
  415. 100<>0f$="29"
  416. d$=y$
  417. j$="01"
  418. g$=e$:h$=f$
  419. g$=y$:h$=
  420. j$-1)
  421. h$=1h$="0"+h$
  422. y$="Jan"
  423. j$="01"
  424. v$-1)
  425. i$=v$
  426. :j$=m$+","+h$+" "+g$+" "+i$:
  427. c(h%,9,j$):
  428. m(pa%):
  429. h(h%,j%+1,
  430. b(h%,j%+1)))
  431. h(h%,4,
  432. b(h%,4)))
  433. h(h%,j%-1,
  434. b(h%,j%-1)))
  435. h(h%,8,
  436. b(h%,8)))
  437. C$="TRUE"
  438. 2:u%=p%:
  439. 3:G%=
  440. 0:b$(q%)="D"
  441. 1:b$(q%)="W"
  442. 2:b$(q%)="M"
  443. 3:b$(q%)="Y"
  444. 4:b$(q%)="I"
  445. 5:b$(q%)=""
  446. c(h%,q%+10,b$(q%))
  447. t($T%)
  448. K(q%+4)
  449. 4:u%=p%:
  450. 5:G%=
  451. &400CF,,d%:
  452. (d%!8
  453. C$="TRUE"
  454. &400D4,,J%
  455. &400D4,,r%
  456. L:m$=
  457. j$,2):c$=
  458. j$,5,2):b$=
  459. j$,8,3)):n$=
  460. j$,4):k%=4:
  461. o%:a$=a$(c%):w$=
  462. a$,2):k$=
  463. a$,3,2):l$=
  464. a$,6,2):o$=
  465. a$,9,4):
  466. m$=w$
  467. c$=k$
  468. b$=l$
  469. n$=o$
  470. a$(c%)=""
  471. 4:b$(k%)="":
  472. c(h%,k%,""):
  473. k%=10
  474. c(h%,k%,""):
  475. K(k%):a$=
  476. b(h%,k%):
  477. a$(c%),16)=a$
  478. a$(c%)=""
  479. c(h%,k%,""):
  480. c(h%,k%+6,""):
  481. n(h%):
  482. s(qa%,N%,ra%):$T%="":
  483. ..C$="TRUE":N%=272:
  484. &400D4,,J%,qa%-64,N%
  485. :N%+=16:C$="FALSE":
  486. &400D4,,r%,qa%-64,N%
  487. d%!16
  488. 0:G%=
  489. 3,5:sa%=d%!40:
  490. sa%<>225
  491. M:C%=
  492. p(p$):
  493. 1282:
  494. c(L$):ta%=U%:U%=
  495. U%-ta%<200
  496. V%+=1
  497. &400DD:
  498. &400EF,0:R%!0=255:$(R%+4)=L$:
  499. &400DF,R%,18,ba%
  500. ,ua%:=ua%
  501. b(m%,j%):!e%=m%:e%!4=j%:
  502. 262350,,e%:=$(e%!28)
  503. i(m%,va%,wa%,xa%,ya%,_%,a$):e%!0=m%:e%!4=va%:e%!8=wa%:e%!12=xa%:e%!16=ya%:e%!20=_%:$(e%+24)=a$:
  504. &400C2,,e%
  505. F%:=F%
  506. M:d%!12=d%!8:d%!16=4:
  507. &400E7,17,d%,d%!4:
  508. n(F%):
  509. O:!e%=F%:
  510. 262347,,e%:
  511. P:K%=
  512. e%!28=-1:
  513. 262341,,e%:
  514. O:e%!0=4:e%!4=5:e%!8=11:e%!12=12:e%!16=-1:
  515. &31,e%,e%+20:za%=1<<(e%!20):Aa%=1<<(e%!24):Ba%=(e%!28+1)*za%:Ca%=(e%!32+1)*Aa%:
  516. P:W%=e%!12-e%!4:H%=e%!16-e%!8:X%=(Ba%-W%)/2:Y%=(Ca%-H%)/2:e%!4=X%:e%!8=Y%:e%!12=X%+W%:e%!16=Y%+H%:
  517. c(m%,j%,G$):!e%=m%:e%!4=j%:
  518. 262350,,e%:
  519. ($e%!28)<>G$
  520. $(e%!28)=G$:e%!8=0:e%!12=0:
  521. 262349,,e%
  522. J:x%=0:
  523. A$," ",x%)>0:x%=
  524. A$," ",x%)+1:
  525. A$-x%+1)
  526. h(m%,j%,Da%):
  527. &400D2,m%,j%,-1,-1,-1,Da%:
  528. &39,,"DragASprite_Stop"
  529. &42401
  530. &400D0,,0:b%=d%:
  531. &400CF,,b%:x%=b%!0:y%=b%!4:m%=b%!12:j%=b%!16:!b%=56:b%!12=0:b%!16=1:b%!20=m%:b%!24=j%:b%!28=x%:b%!32=y%:b%!36=924:b%!40=3314:$(b%+44)=
  532. b(u%,0)):
  533. &400E7,17,d%,m%,j%:C%=
  534. j(B$):
  535. B$,".")>0:B$=
  536. B$,".")+1):
  537. f(M$):
  538. &23,M$,S%,255,0,3
  539. ,,b%:S%?b%=13:=$S%
  540. Q-p$="":g%=d%+43:
  541. g%?1<>0:g%+=1:p$+=
  542. b(u%,0)
  543. b(O%,Fa%,g%,_%,a$):O%!0=Fa%:O%!4=g%:O%!8=_%:$(O%+12)=a$:
  544. D:l%=
  545. "<Diary$Dir>.Messages":P%=0:
  546. H$<>""
  547. H$,1)<>"#"
  548. P%+=