home *** CD-ROM | disk | FTP | other *** search
/ The Datafile PD-CD 2 / DATAFILE_PDCD2.iso / utilities2 / meditate / MEditate / !MEditate / Lunchtime (.txt) < prev    next >
RISC OS BBC BASIC V Source  |  1994-02-07  |  29KB  |  1,600 lines

  1.  !MEditate v. 3.31 (c) A.J.Bennett N.Davies 7/2/94
  2. Z=3.31:
  3. 6,113,1:
  4. &406c2:
  5. 46,290,Gy%,"menuscreen",0,0:
  6. R_%,s_%,Oy%:
  7. Oy%<>0:
  8. V(1):
  9. Py:F%=
  10. ("<MagEdit$Dir>.magsystem.MagData"):J$=
  11. #F%:__%=
  12. #F%):J$=
  13. #F%:ky%=
  14. #F%):J$=
  15. #F%:BJ%=
  16. #F%):J$=
  17. #F%:wJ%=
  18. #F%):J$=
  19. #F%:VJ%=
  20. #F%):J$=
  21. #F%:k$=
  22. #F%:J$=
  23. #F%:U%=
  24. #F%):J$=
  25. #F%:Py%=
  26. #F%):J$=
  27. #F%:H%=
  28. #F%):J$=
  29. #F%:s%=
  30. #F%):J$=
  31. #F%):
  32. W%(G_%),G%(G_%),B%(G_%),P%(G_%):
  33. G_%:J$=
  34. #F%:W%(A%)=
  35. #F%):B%(A%)=
  36. #F%):G%(A%)=
  37. #F%):P%(A%)=
  38. #F%):
  39. _y:*fx4,2
  40. *fx225,170
  41. *fx226,190
  42. *fx227,210
  43. ((s%-H%)/32)-1:p%=
  44. ((Py%-U%)/16):h%=0:
  45. A$(B%*__%),M$(B%*__%):f%=0:
  46. Z$(ky%),Z%(ky%*0.8),M%(ky%*0.8),S%(ky%*0.8),F%(ky%*0.8):
  47. A%(ky%*0.8):C$="":sy%=0:gy%=1:by%=2:jy%=4:Bu%=5:Xu%=7:Qu%=8:H$="":
  48. X_%255,vJ%1023:
  49. S$(__%)
  50. MJ%255,uJ%255,C$(78),W$(78),J$(30):
  51. C%(B%+1):I$="":
  52. Gy%BJ%:
  53. uy%wJ%:
  54. Q%VJ%:!Gy%=BJ%:!uy%=wJ%:!Q%=VJ%:Q%!4=0:Q%!8=16:Q%!12=16:ly%=0:z_%=0:Z_%=
  55. :s$="<MagEdit$Dir>.magsystem":A=(Py%+U%)/2:F%=
  56. (s$+".bannerfile"):ly%=
  57. 8,255,s$+".bannerfile",Gy%+4:
  58. ly%>8
  59. F$(ly%)
  60. F$(9)
  61. c(Gy%,ly%):
  62. ly%:F$(A%)=J$(A%):
  63. :DJ%=800:
  64. j_%DJ%:!j_%=DJ%:
  65. 8,255,s$+".!pointer",j_%+4:
  66. P$(b_%,12),J%(b_%):
  67. J%(A%):
  68. J%(A%):
  69. P$(A%,b%):
  70. G$(FJ%,3),N%(FJ%):
  71. N%(A%):
  72. N%(A%):
  73. G$(A%,b%):
  74. A_:`y%=
  75. 8,5,"<MagEdit$Dir>.articles.check"
  76. Zy%=1
  77. s`y%=
  78. :G$="<MagEdit$Dir>.articles.text":F$="<MagEdit$Dir>.articles.palettes":R$="<MagEdit$Dir>.articles.sprites"
  79. 8,5,"<MagEdit$Dir>.^.articles.check"
  80. Zy%=1
  81. y`y%=
  82. :G$="<MagEdit$Dir>.^.articles.text":F$="<MagEdit$Dir>.^.articles.palettes":R$="<MagEdit$Dir>.^.articles.sprites"
  83. 11,16)"Please Insert a MAGAZINE DISK into drive 0 and press a key":P=
  84. :*MOUNT 0
  85. 8,5,"$.articles.check"
  86. Zy%=1
  87. O`y%=
  88. :G$="$.articles.text":F$="$.articles.palettes":R$="$.articles.sprites"
  89. J(F$+"."+k$):
  90. &406c2:
  91. J("wimppalette "+F$+".!Magpal"):
  92. J(My$):
  93. (My$):
  94. 46,36+256,j_%,"ptr_hand",2,0,0,0,0:
  95. 46,36+256,j_%,"ptr_cross",2,16,8,0,0:
  96. 23,253,254,3,50,115,254,112,48,0:
  97. 23,254,126,148,148,116,20,20,126,0:
  98. 23,253,0,0,0,0,0,0,0,0:
  99. 23,254,0,0,0,0,0,0,0,0:
  100.  6,"Save Menufiles","Load Menufile","ASCII to Magtext","Magtext to ASCII","* command","Exit"
  101.  7,"Display Info","Add Comment","Add Banner","Assign Menu","Assign Article","Change Next Colours","Change Default Colours"
  102.  12,"Edit Line","Insert Line","Delete Line","Centre Line","Left Justify","Right Justify","Change Left Margin","Change Right Margin","Change Line Colour","Insert Graphic","Delete Graphic","Change Fg/Bg"
  103.  10,"
  104. ","","","","","","","","","
  105.  5,"Reposition","Change fg/bg","Change Item","Delete","Centre Item"
  106.  1,"Edit Mode On/Off"
  107.  4,"Save Article","Load Sprites","Load New Palette","Load New Font"
  108.  1,"Formatting Characters On/Off"
  109.  3,"1File Options","2Menu Options","6Edit Mode"
  110.  3,"1File Options","5Edit Options","6Edit Mode"
  111.  3,"7File Options","3Edit Article","8Misc"
  112. Z%,C%,D%:
  113. 50,30);"X:";Z%,
  114. 60,30);"Y:";C%,:
  115. D%<>0
  116. R_%,s_%,Oy%:
  117. Oy%=0:
  118. A(Fu%,y%,D%):
  119. &40743,(Fu%<<8)+(y%<<16)+(D%<<24):
  120. Z%<Py%
  121. Z%>U%
  122. C%<s%
  123. C%>H%
  124. Z%<G%(1)
  125. Z%>W%(1)
  126. C%<P%(1)
  127. C%>B%(1)
  128. Z%<G%(3)
  129. Z%>W%(3)
  130. C%<P%(3)
  131. C%>B%(3)
  132. Z%<G%(4)
  133. Z%>W%(4)
  134. C%<P%(4)
  135. C%>B%(4)
  136. Z:M%=0:
  137. Z%>Z%(A%)
  138. Z%<S%(A%)
  139. C%>M%(A%)
  140. C%<F%(A%)
  141. M%=A%
  142. M%<>0
  143. Dy(M%):
  144. V(1):
  145. H("Are You Sure That You Want To Quit? (Y/N)",`$):
  146. `$="yes"
  147. J(F$+".!Palette"):*FX25,0
  148. *nodir
  149. C    *QUIT
  150. _(1,N_%,Cy%):
  151. L(`%,Sy%)
  152. L(`%,Sy%):Yy%=`%:Uy%=Sy%:
  153. A(0,0,0):
  154. A(255,255,255):
  155. A-(27*8),s%-(32):
  156. ;"Menu : ";Ry%;") ";v$:
  157. A-(27*8),s%-(2*32):
  158. ;"Root Menu : ";ZJ%:
  159. A-(27*8),s%-(4*32):
  160. ;"Number of menu items : ";By%:
  161. U%+50,s%-(6*32):
  162. "Default Foreground Colour : ";Yy%:
  163. U%+50,s%-(7*32)
  164. "Default Background Colour : ";Uy%:
  165. A-(21*16),s%-(20*32):
  166. "- Click To Continue -":
  167. R_%,s_%,Oy%:
  168. Oy%<>0:
  169. _(i_%,
  170. a_%):
  171. 46,16+256,Q%,"mbtemp",0,0,991,1280,1023:
  172. A(0,25,120):
  173. 0,991,1280,1023:
  174. A(255,255,255):
  175. N%(i_%):
  176. 240*(A%-1)+16,1019:
  177. ;" ";
  178. G$(i_%,A%),2):
  179. 1279-(
  180. $)+1)*16,1019:
  181. 4:PJ%=0:Ny%=0:fy%=0:zy%=0:K%=-1:T%=-1:w%=-1:z%=-1
  182. Z%,C%,D%:
  183. C%>=991
  184. D%<>0:
  185. Z%,C%,D%:o_%=(Z%-16)/240+1:
  186. o_%<=N%(i_%)
  187. G$(i_%,o_%),1))
  188. Ny%<>PJ%
  189. PJ%<>0
  190. T(Ny%,240*(o_%-1)+16,920-J%(Ny%)*32+32):PJ%=Ny%:fy%=0:zy%=0
  191. Ny%>0
  192. fy%=zy%:zy%=
  193. ((T%+z%+16-C%)/32)*((Z%>K%)*(Z%<K%+w%)):
  194. fy%<>0
  195. fy%<>zy%
  196. fy%<=J%(Ny%)
  197. K%+4,T%+z%+20-(fy%*32),w%-8,-32
  198. zy%<>fy%
  199. zy%>0
  200. zy%<=J%(Ny%)
  201. K%+4,T%+z%+20-(zy%*32),w%-8,-32
  202. D%=0:
  203. Z:a_%=0:
  204. Ny%>0
  205. Z%>K%
  206. Z%<K%+w%
  207. C%>T%
  208. C%<T%+z%
  209. ((T%+z%+16-C%)/32)
  210. a_%<0
  211. a_%>J%(Ny%)
  212. a_%=0
  213. 46,290,Q%,"mbtemp",0,991:
  214. M("Enter CLI command"):
  215. B(j$,70):
  216. :Z_%=
  217. J(j$):
  218. "Press a key to continue":J=
  219. 24,U%;H%;Py%;s%;:
  220. H("SAVE BEFORE QUITING (Y/N)",Ay$):
  221. Ay$="yes"
  222. o    *FX25
  223. &406c2:
  224. "  Error Number ";
  225. ;" at line ";
  226. :*FX25
  227. &406c2:
  228. N(G$,q$,B$):
  229. B$<>"MagTex"
  230. M("This is not a MagText file"):
  231. tND$=q$:
  232. M("Enter a file name"):
  233. B(D$,40):
  234. O(D$)=
  235. M("Invalid filename"):
  236. &406c0:F%=
  237. (G$+"."+q$):
  238. #F%,Z,J$,J$,S%,J$:
  239. #F%,S$(A%):
  240. #F%,A$(A%):
  241. #F%:x%=
  242. (G$+"."+D$):
  243. S%-1:
  244. A$(A%))
  245. (254):
  246. A$(A%),
  247. (A$(A%))-1);
  248. (253):
  249. A$(A%),
  250. (A$(A%))-1)
  251. #x%,A$(A%)
  252. A$(S%-1))<>
  253. (253)
  254. (10);
  255. ("settype "+G$+"."+D$+" Text"):
  256. &406c1:
  257. N(G$,q$,B$):
  258. B$<>"Text  "
  259. M("This is not a Text file"):
  260. &406c0:S%=1:A$(0)="":M$(0)="":oJ%=1:A$="":U$="":I$="":H$="":
  261. Q(15,0,0,"",M$):S$()=M$:S%=1:A$(0)="":
  262. P(0,p%,15,0,"L",Y$):M$()=Y$:F%=
  263. (G$+"."+q$):
  264. #F%):
  265. }"A$(S%)+=
  266. (253):S%+=1:A$(S%)=""
  267. :A$(S%)=A$(S%)+A$
  268. (A$(S%))=p%
  269. py:S%=S%+1
  270. #(F%)
  271. S%>B%*__%:
  272. A$(S%)+=
  273. (253):S%+=1
  274. &406c1:
  275. O(q$):A$()="":
  276. A$(S%),1)<>" ":A$(S%+1)=
  277. A$(S%),1)+A$(S%+1):A$(S%)=
  278. A$(S%),
  279. (A$(S%))-1):
  280. :A$(S%)=A$(S%)+
  281. (254):
  282. O(D$):
  283. M("Enter a file name"):
  284. B(D$,40):
  285. O(D$)=
  286. M("Invalid filename, Try Again"):
  287. B(D$,40):
  288. O(D$)=
  289. &406c0:x%=
  290. (G$+"."+D$):
  291. #x%,Z:
  292. #x%,U$:
  293. #x%,I$,S%,H$:
  294. #x%,S$(A%):
  295. #x%,A$(A%):
  296. :g$="":
  297. M$(A%)=g$
  298. #x%,""
  299. #x%,M$(A%):g$=M$(A%)
  300. J("SetType "+G$+"."+D$+" MagText"):
  301. &406c1:
  302. &406c0:t%=
  303. :S$()="PAA":F%=
  304. (G$+"."+
  305. M(A_%)):
  306. #F%,Z:
  307. M("This is file is incompatible with this version of the Editor"):
  308. #F%,U$,I$,S%,H$:
  309. #F%,S$(A%):
  310. #F%,A$(A%):
  311. #F%,M$(0):
  312. #F%,M$(A%):
  313. M$(A%)=""
  314. M$(A%)=M$(A%-1)
  315. I$<>""
  316. J("wimppalette "+F$+"."+I$)
  317. H$<>""
  318. J(F$+"."+H$)
  319. U$<>""
  320. (R$+"."+U$):z_%=
  321. 8,255,R$+"."+U$,uy%+4
  322. &406c1:
  323. e(R%):aJ%=0:TJ%=
  324. :c_%=
  325. A$(R%),
  326. (253)):
  327. c_%<>
  328. A$(R%)
  329. c_%<>0
  330. A%=S%+1
  331. A$(A%),A$(A%+1):
  332. M$(A%),M$(A%+1):
  333. P(0,p%,
  334. N(R%),
  335. Q(R%),"L",M$):M$(R%+1)=M$:A$(R%+1)=
  336. A$(R%),c_%+1):A$(R%)=
  337. A$(R%),c_%):S%+=1:R%+=1:aJ%+=1
  338. :TJ%=
  339. Z%=R%-aJ%
  340. wy(Z%):
  341. wy(g%):
  342. e_%,Z%,A$:
  343. &406c0:Fy$="":iy%=S%-1:
  344. A$(g%),1))<253
  345. A$(g%)=A$(g%)+
  346. (254)
  347. A$(g%),2):
  348. (A$)<>32
  349. A$,2))=254
  350. JL%=g%:
  351. L%+=1:
  352. L%>S%-1
  353. (A$(L%))>1:D%=
  354. A$(L%)," "):
  355. (A$(L%))-1
  356. GA$(g%)=
  357. A$(g%),
  358. (A$(g%))-1)+
  359. A$(L%),D%)+
  360. (254):A$(L%)=
  361. A$(L%),D%+1)
  362. !L%=g%:
  363. L%-=1:
  364. S(L%)>0:
  365. A$(g%)," "):
  366. (A$(L%))+D%<=
  367. S(L%)+1
  368. A$(L%),1)=
  369. (254)
  370. g%=L%
  371. :e_%=
  372. S(g%):L%=
  373. A$(g%),
  374. (253)):
  375. (A$(g%))>e_%+1
  376. (L%<>
  377. (A$(g%))
  378. L%<>0)
  379. CQ$="":Z%=g%-1:
  380. :Z%+=1:Q$+=A$(Z%):
  381. Q$,1)=
  382. (254)
  383. (Q$)-1)
  384. h(Z%):
  385. Z%>=S%-1
  386. Q$="":
  387. Q$<>""
  388. kiy%=S%-1:e_%=
  389. S(S%-1):
  390. P(0,p%,
  391. N(S%-1),
  392. Q(S%-1),"L",M$):
  393. :iy%+=1:M$(iy%)=M$:
  394. h(iy%):
  395. Q$="":Cu%=iy%-S%-1
  396. :e%=g%:c%=e%+1:
  397. A$(e%),1)<>
  398. (253)
  399. c%<=S%-1:sJ%=
  400. S(e%)-
  401. (A$(e%))+1:cy%=0:O$="":
  402. :cy%=
  403. A$(c%)," "):
  404. cy%=0
  405. A$(c%),1)=
  406. (254)
  407. (A$(c%))-1
  408. (A$(c%))
  409. (O$)<=sJ%
  410. CO$+=
  411. A$(c%),cy%):A$(c%)=
  412. A$(c%),cy%+1):
  413. A$(c%)=""
  414. A$(c%)=
  415. (254)
  416. (A$(c%))<=1
  417. c%+=1
  418. (O$)>sJ%
  419. (253))<>0:
  420. A$(e%),1)>
  421. (250)
  422. A$(e%)=
  423. A$(e%),
  424. (A$(e%))-1)
  425. /A$(e%)+=O$:
  426. (A$(e%))>3
  427. A$(e%),1)<>
  428. (253)
  429. A$(e%),
  430. (A$(e%))-2,1):
  431. ".?!:",A$)
  432. A$(c%),1)=" "
  433. !A$(c%)=
  434. A$(c%),2):A$(e%)+=" "
  435. O$,1)<>
  436. (253)
  437. A$(e%)+=
  438. (254)
  439. e%+=1:
  440. e%=c%
  441. c%+=1
  442. :e%+=1:
  443. e%=c%
  444. c%>S%-1
  445. :S%=iy%+1:
  446. A$(S%-1)=""
  447. A$(S%-1)=
  448. (254):S%-=1:
  449. :A$(0)=
  450. (S%):
  451. &406c1:
  452. h(wy%):e_%=
  453. S(wy%):A$(wy%)=
  454. Q$,e_%):Ly%=
  455. A$(wy%),
  456. (253)):
  457. Ly%=0
  458. (A$(wy%)):
  459. Ly%>0
  460. A$(wy%),Ly%,1)<>" "
  461. Ly%=0:Ly%-=1:
  462. :A$(wy%)=
  463. A$(wy%),Ly%)+
  464. (254)
  465. :A$(wy%)=
  466. A$(wy%),Ly%)
  467. Q$,Ly%+1):
  468. N(x_%):=
  469. M$(x_%),3,1))
  470. Q(x_%):=
  471. M$(x_%),4,1))
  472. R(x_%):=
  473. M$(x_%),5)
  474. B(x_%):=
  475. M$(x_%),1))
  476. S(x_%):=
  477. M$(x_%),2,1))
  478. P(Vu%,Mu%,lJ%,Du%,Cy$,
  479. N$):N$=
  480. H(Vu%):N$=N$+
  481. H(Mu%):N$=N$+
  482. H(lJ%):N$=N$+
  483. H(Du%):N$=N$+Cy$:
  484. H(Qy%):=
  485. ("A")+Qy%)
  486. U(P$):=
  487. (P$)-
  488. ("A")
  489. Q(Hu%,Uu%,Nu%,Sy$,
  490. N$):N$=
  491. H(Hu%):N$+=
  492. H(Uu%):N$+=
  493. H(Nu%):N$+=Sy$:
  494. L(n_%):=
  495. S$(n_%),1))
  496. X(n_%):=
  497. S$(n_%),2,1))
  498. W(n_%):=
  499. S$(n_%),3,1))
  500. K(n_%):=
  501. S$(n_%),4)
  502. G:u%=h%:h%=
  503. ((S%-1)/B%):
  504. (S%-1)/B%<>h%
  505. h%+=1
  506. h%>u%
  507. L(u%),
  508. X(u%),0,"",S$(h%))
  509. F_:u_%=
  510. G:W%=1:
  511. U(W%):KJ%=
  512. Z%,C%,q%:
  513. 50,30);"X:";Z%,
  514. 60,30);"Y:";C%,:
  515. H("This article has been modified. Do you want to save? Y/N",A$):
  516. A$="yes"
  517. M(A_%))
  518. v:A$()="":M$()="":
  519. H$<>""
  520. J(F$+".Large"):H$=""
  521. I$<>""
  522. J("wimppalette "+F$+".!magpal")
  523.  S$()="PAA":z_%=0:h%=0:W%=0:
  524. U(H_%):
  525. 46,290,Gy%,"menuscreen",0,0:Z_%=
  526. F:Qy%=
  527. L(H_%):D%=
  528. X(H_%):
  529. D%<>Qy%
  530. 0,128+D%:
  531. 0,Qy%
  532. W(H_%)>0
  533. K(H_%))
  534. 5R