home *** CD-ROM | disk | FTP | other *** search
/ The Datafile PD-CD 5 / DATAFILE_PDCD5.iso / utilities / w / wordenter / !WordEnter / !RunImage (.txt) < prev    next >
RISC OS BBC BASIC V Source  |  1993-08-27  |  7KB  |  290 lines

  1.  >!RunImage
  2.  A word enterer
  3.  NSW 26/08/93
  4. <n$="1.13 (26th August 93)":
  5. $+" at line "+
  6. r:b$=
  7. b$<>""
  8. g(b$)
  9. $+" at line "+
  10. "Wimp_Poll",,c%
  11. "Wimp_RedrawWindow",,c%
  12. "Wimp_OpenWindow",,c%
  13. "Wimp_CloseWindow",,c%
  14. 17,18,19:
  15. "Wimp_CloseDown":
  16. i(u%,d%,d%<5):
  17. b(u%):p%=
  18. "Wimp_Poll",,c%
  19. "Wimp_OpenWindow",,c%
  20. c%!16
  21. 5:p%=
  22. 6:p%=
  23. 17,18
  24. a(u%):
  25. d:z%=(A%/50)+1:!a%=i%:
  26. a%!4=3
  27. z%+1:
  28. "Wimp_DeleteIcon",,a%:
  29. :A%=0:C%=-194:B%=aa%:a%!0=_%:a%!4=B%:a%!8=`%:a%!12=ba%:
  30. "Wimp_SetExtent",i%,a%:
  31. a(i%):
  32. b(i%):
  33. g(b$):$L%=b$:g%=
  34. (b$):
  35. a$<>""
  36. f(a$)
  37. #g%:t%=
  38. "Wimp_CreateMenu",,-1:
  39. a(v%):
  40. #-b$="":e%=c%+43:
  41. e%?1<>0:e%+=1:b$+=
  42. a(v%,0)
  43. b$,".",0)=0
  44. d("sav")):
  45. y(b$):M%=
  46. y(b$):g%=
  47. (b$):z%=(A%/50)+1:
  48. ca%=3
  49. z%+1:
  50. a(i%,ca%):
  51. "OS_CLI","SetType "+b$+" 0E6":
  52. u:da%=c%!24:m%=!c%:
  53. da%=13
  54. a(n%)
  55. a(j%)
  56. a(o%)
  57. "Wimp_ProcessKey",da%
  58. j:a$=
  59. a(n%,1):
  60. f(a$):t%=
  61. k:a$=
  62. a(j%,1):
  63. D%,N%:
  64. z%-2:e$=$(D%+e%*50):
  65. e$<>a$
  66. f(e$)
  67. e$<>""
  68. a(j%):t%=
  69. l:l$=f$:o$=
  70. a(o%,1):
  71. D%,N%:
  72. z%-2:e$=$(D%+e%*50):
  73. e$<>l$
  74. f(e$)
  75. e$=l$
  76. f(o$)
  77. e$<>""
  78. a(j%):t%=
  79. z:a$=
  80. a(m%,d%):
  81. m(a$):
  82. m(a$):
  83. "OS_Byte",138,0,
  84. a$,O%):
  85. "win":
  86. e(n%,1,""):
  87. b(n%):
  88. n(n%,1,0)
  89. f$<>""
  90. e(o%,1,f$):
  91. b(o%):
  92. n(o%,1,
  93. f$<>""
  94. e(j%,1,f$):
  95. b(j%)
  96. "bar":
  97. 3:K%=
  98. s:x%=!c%:y%=c%!4:ea%=c%!8:m%=c%!12:d%=c%!16:fa%=(m%=-2):
  99. h$="bar":f$=""
  100. h$="win":f$=""
  101. :h$="win":f$=
  102. a(m%,d%)
  103. A(x%,y%)
  104. b(i%)
  105. a(n%)
  106. a(n%)
  107. a(j%)
  108. a(j%)
  109. a(o%)
  110. a(o%)
  111. 16,64:
  112. B:x%=!c%:y%=c%!4:c%!4=5:c%!8=x%-76:c%!16=x%+76:c%!12=y%-52:c%!20=y%+52:c%!24=0:c%!32=&7FFFFFFF:c%!28=0:c%!36=&7FFFFFFF:
  113. 6,161,28
  114. ,,f%:
  115. ga%>=310
  116. "DragASprite_Start",197,1,"file_0e6",c%+8,c%+24
  117. "Wimp_DragBox",,c%
  118. o(ha%):d$=
  119. $:c$=
  120. d$,8,3):d$=
  121. d$,5,11):P%=
  122. (d$):
  123. 1,21,31:i$="st"
  124. 2,22:i$="nd"
  125. 3,23:i$="rd"
  126. :i$="th"
  127. "Jan":c$="January"
  128. "Feb":c$="February"
  129. "Mar":c$="March"
  130. "Apr":c$="April"
  131. "May":c$="May"
  132. "Jun":c$="June"
  133. "Jul":c$="July"
  134. "Aug":c$="August"
  135. "Sep":c$="September"
  136. "Oct":c$="October"
  137. "Nov":c$="November"
  138. "Dec":c$="December"
  139. 1:d$=
  140. P%+i$+" "+c$+" "+
  141. d$,4)
  142. 2:d$=c$+" "+
  143. P%+i$+" "+
  144. d$,4)
  145. m(d$):
  146. A(ia%,ja%):
  147. h$="bar"
  148. ja%=296:k%=h%
  149. h$="win"
  150. k%=h%+200
  151. "Wimp_CreateMenu",,k%,ia%-64,ja%:
  152. c%!16
  153. 0:K%=
  154. 3,5:ka%=c%!40:
  155. ka%<>230
  156. 3b$="":e%=c%+43:
  157. e%?1<>0:e%+=1:b$+=
  158. #c%!20,"Run "+
  159. g("Enter$Dir")
  160. 1282:
  161. i(l%,d%,la%):!a%=l%:a%!4=d%:a%!8=0:a%!12=1<<23:
  162. "Wimp_SetIconState",,a%:
  163. C!a%=l%:a%!4=d%:a%!8=1<<23:a%!12=1<<23:
  164. "Wimp_SetIconState",,a%
  165. i(u%,d%,d%>4):
  166. b(u%):p%=
  167. "Wimp_Poll",,c%
  168. "Wimp_OpenWindow",,c%
  169. c%!16
  170. g(b$):p%=
  171. g(b$):p%=
  172. 4:p%=
  173. 17,18
  174. g(b$)
  175. a(u%):
  176. g(p$):
  177. "OS_ReadVarVal",p$,Q%,255,0,3
  178. ,,b%:Q%?b%=13:=$Q%
  179. a% 512,c% 512,ma% 512,na% 512,h% 512,r% 512,oa% 512,R% 512,pa% 20,N% 8000,qa% 512,ra% 512,sa% 512,ta% 512,ua% 512,va% 512:
  180. D% 8000,L% 256,wa% 512,Q% 256,xa% 256,ya% 512,za% 32:
  181. "Wimp_Initialise",200,&4B534154,"Word Enterer"
  182. $pa%="Word Enterer":K%=
  183. :C%=-194:A%=0:Aa%=
  184. :S%=0:T%=0:Ba%=
  185. e(-1,0,0,68,68,12298,"!wordenter",0,0,0):g%=
  186. "<Enter$Dir>.Sprites":U%=
  187. #g%+16:
  188. q% U%:
  189. "OS_SpriteOp",256+10,q%,"<Enter$Dir>.Sprites":
  190. "Wimp_OpenTemplate",,"<Enter$Dir>.Templates":Ca%=
  191. b(ma%,na%,511,"info",q%):i%=
  192. b(r%,oa%,511,"main",q%):o%=
  193. b(ua%,va%,511,"edit",q%):n%=
  194. b(qa%,ra%,511,"edit",q%):j%=
  195. b(sa%,ta%,511,"edit",q%)
  196. b(wa%,L%,255,"save",q%):u%=
  197. b(ya%,xa%,255,"modd",q%):
  198. "Wimp_CloseTemplate":$ra%="Add word":
  199. e(n%,0,"Please enter the word below"):$ta%="Delete word":
  200. e(j%,0,"Are you sure you wish to delete this word?")
  201. $(na%+106)=n$:$L%="WordList":_%=r%!40:B%=r%!44:aa%=B%:`%=r%!48:ba%=r%!52:I%=r%+88+(((r%!84)-1)*32):Da%=I%!0:Ea%=I%!4:Fa%=I%!8:Ga%=I%!12:
  202. r:$h%="Word Enterer":h%!12=459271:h%!16=16*13:h%!20=44:h%!24=0:
  203. c(h%+28,0,Ca%,&7091031,"Info"):
  204. c(h%+52,0,v%,&7091031,"Save"):
  205. c(h%+76,0,-1,&7091031,"New file"):
  206. c(h%+100,128,-1,&7091031,"Quit"):k%=h%+200
  207. $k%="Word menu":k%!12=459271:k%!16=16*10:k%!20=44:k%!24=0:
  208. c(k%+28,0,-1,&7091031,"Add"):
  209. c(k%+52,0,-1,&7091031,"Edit"):
  210. c(k%+76,128,-1,&7091031,"Delete"):
  211. f(k$):Ha%=
  212. e(i%,16,C%,654,C%+48,&700313D,"",N%+A%,-1,50):
  213. e(i%,Ha%,k$):C%-=50:A%+=50:
  214. "Wimp_ForceRedraw",i%,Da%,Ea%,Fa%,Ga%:Ea%-=50:Ga%-=50:B%-=50:a%!0=_%:a%!4=B%:a%!8=`%:a%!12=ba%:
  215. "Wimp_SetExtent",i%,a%:
  216. F:g%=
  217. "<Enter$Dir>.Messages":E%=0:
  218. #g%:E%+=1:
  219. a$(E%):
  220. #g%=0:
  221. E%:a$(e%)=
  222. c(F%,Ia%,e%,V%,a$):F%!0=Ia%:F%!4=e%:F%!8=V%:$(F%+12)=a$:
  223. b(Z%,d%,Ja%,m$,Ka%):
  224. $+" whilst trying to load template '"+m$+"'"):
  225. "Wimp_LoadTemplate",,Z%,d%,d%+Ja%,-1,m$,0:Z%!64=Ka%:
  226. "Wimp_CreateWindow",,Z%
  227. s%:=s%
  228. c(q$):La%=S%:S%=
  229. S%-La%<200
  230. T%+=1
  231. "Wimp_CloseDown":
  232. "Wimp_CommandWindow",0:R%!0=255:$(R%+4)=q$:
  233. "Wimp_ReportError",R%,18,pa%
  234. ,Ma%:=Ma%
  235. a(l%,d%):!a%=l%:a%!4=d%:
  236. "Wimp_GetIconState",,a%:=$(a%!28)
  237. e(m%,Na%,Oa%,Pa%,Qa%,V%,a$,Ra%,Sa%,Ta%):a%!0=m%:a%!4=Na%:a%!8=Oa%:a%!12=Pa%:a%!16=Qa%:a%!20=V%:
  238. Ra%=0
  239. :$(a%+24)=a$:
  240. :a%!24=Ra%:a%!28=Sa%:a%!32=Ta%
  241. "Wimp_CreateIcon",,a%
  242. s%:=s%
  243. a(s%):!a%=s%:
  244. "Wimp_GetWindowState",,a%:a%!28=0:
  245. "Wimp_CloseWindow",,a%:
  246. C:c%!12=c%!8:c%!16=4:
  247. "Wimp_SendMessage",17,c%,c%!4:
  248. b(s%):
  249. G:!a%=s%:
  250. "Wimp_GetWindowState",,a%:
  251. H:Aa%=
  252. &a%!28=-1:
  253. "Wimp_OpenWindow",,a%:
  254. G:a%!0=4:a%!4=5:a%!8=11:a%!12=12:a%!16=-1:
  255. "OS_ReadVduVariables",a%,a%+20:Ua%=1<<(a%!20):Va%=1<<(a%!24):Wa%=(a%!28+1)*Ua%:Xa%=(a%!32+1)*Va%:
  256. H:W%=a%!12-a%!4:H%=a%!16-a%!8:X%=(Wa%-W%)/2:Y%=(Xa%-H%)/2:a%!4=X%:a%!8=Y%:a%!12=X%+W%:a%!16=Y%+H%:
  257. e(l%,d%,k$):!a%=l%:a%!4=d%:
  258. "Wimp_GetIconState",,a%:$(a%!28)=k$:a%!8=0:a%!12=0:
  259. "Wimp_SetIconState",,a%:
  260. n(l%,d%,O%):
  261. "Wimp_SetCaretPosition",l%,d%,-1,-1,-1,O%:
  262. "OS_GetEnv"
  263. (g$)<6
  264. <x%=0:
  265. g$," ",x%)>0:x%=
  266. g$," ",x%)+1:
  267. (g$)-x%+1)
  268. "OS_SWINumberFromString",,"DragASprite_Stop"
  269. "DragASprite_Stop"
  270. "Wimp_DragBox",,0:b%=c%:
  271. "Wimp_GetPointerInfo",,b%:x%=b%!0:y%=b%!4:l%=b%!12:d%=b%!16:!b%=56:b%!12=0:b%!16=1:b%!20=l%:b%!24=d%:b%!28=x%:b%!32=y%:b%!36=0:b%!40=4095:$(b%+44)=
  272. a(v%,0)):
  273. "Wimp_SendMessage",17,c%,l%,d%:M%=
  274. h(j$):
  275. j$,".")>0:j$=
  276. j$,".")+1):
  277. E:m%=c%!32:d%=c%!36:
  278. d("bar"))
  279. I(a$):U%=
  280. a$+1:c%!12=c%!8:c%!16=1283:$(c%+20)=a$+
  281. 0:!c%=(24+U%)
  282. "Wimp_SendMessage",17,c%,c%!4:
  283. d(a$):
  284. E%:e%=
  285. a$(G%),":"):
  286. a$(G%),e%-1):
  287. r$=a$
  288. a$(G%),
  289. a$(G%)-e%)
  290.