home *** CD-ROM | disk | FTP | other *** search
/ Archive Magazine 1997 / ARCHIVE_97.iso / _archive / archive (.txt) < prev    next >
RISC OS BBC BASIC V Source  |  1997-08-13  |  9KB  |  330 lines

  1.  --> Archive CD intro
  2.  This program and all documentation 
  3.  David Holden 1996
  4. version_number$="0.03"
  5. initialise
  6. report_error(
  7. openit(main_w%)
  8.  "Wimp_Poll",mask%,blk% 
  9.  reason%
  10.  reason% 
  11. "Wimp_OpenWindow",,blk%
  12. "Wimp_CloseWindow",,blk%
  13. click
  14. drag_term
  15. "Wimp_ProcessKey",blk%!24
  16. select
  17.  17,18:
  18.  blk%!16=0 
  19. select
  20. "Wimp_GetPointerInfo",,blk%+&C0:mb%=blk%!&C8:my%=blk%
  21.  blk%!4=-1 
  22.  !blk% 
  23. openit(main_w%)
  24.  J    
  25.  2:more%=
  26. open_text(t_whatson%,n_whatson%):more_ptr%=t_whatson%
  27. !9    
  28.  3:more%=
  29. open_text(t_copyright%,n_copyright%)
  30. "1    
  31.  4:more%=
  32. open_text(t_about%,n_about%)
  33. #1    
  34.  5:more%=
  35. open_text(t_whycd%,n_whycd%)
  36. $9    
  37.  6:more%=
  38. open_text(t_subscribe%,n_subscribe%)
  39.  mb%=1 
  40. "Wimp_CreateMenu",,main_m%,mx%,mh%
  41. click
  42.  icn%,win%
  43. "Wimp_GetPointerInfo",,blk%+&C0:mb%=blk%!&C8:my%=blk%!&C4
  44. win%=blk%!12:icn%=blk%!16
  45.  win% 
  46.  icn%=icon% 
  47.           
  48.  mb% 
  49. 2#           
  50. openit(main_w%)
  51. 3P           
  52.  2:mx%=blk%!&C0-120:mh%=464:
  53. "Wimp_CreateMenu",,main_m%,mx%,mh%
  54.           
  55.          
  56.  main_w%:
  57.  icn% 
  58. 7_               
  59.  im_whatson%:more%=
  60. open_text(t_whatson%,n_whatson%):more_ptr%=t_whatson%
  61. 8P               
  62.  im_copyright%:more%=
  63. open_text(t_copyright%,n_copyright%)
  64. 9D               
  65.  im_about%:more%=
  66. open_text(t_about%,n_about%)
  67. :P               
  68.  im_subscribe%:more%=
  69. open_text(t_subscribe%,n_subscribe%)
  70. ;D               
  71.  im_whycd%:more%=
  72. open_text(t_whycd%,n_whycd%)
  73.               
  74.  text_w%:
  75.  icn%=it_more% 
  76. >               
  77.  more_ptr% 
  78. ?U               
  79.  t_whatson%:more_ptr%=t_more%:more%=
  80. open_text(t_more%,n_more%)
  81. @S               
  82.  t_more%::more_ptr%=t_even%:more%=
  83. open_text(t_even%,n_even%)
  84. A\               
  85.  t_even%::more_ptr%=t_whatson%:more%=
  86. open_text(t_whatson%,n_whatson%)
  87.               
  88. openit(w%)
  89. G,!blk2%=w%:
  90. "Wimp_GetWindowState",,blk2%
  91. H%blk2%!20=0:blk2%!24=0:blk2%!28=-1
  92. "Wimp_OpenWindow",,blk2%
  93. open_text(p%,n%)
  94.  p%=0 
  95.  p%=0 
  96.  c%=0 
  97.  n%-1
  98. set_str(text_w%,c%,$p%)
  99. next_line(p%)
  100.  c%<=text_max%:
  101. set_str(text_w%,c%,""):c%+=1:
  102.  more%=
  103. set_str(text_w%,it_more%,
  104. message(1)) 
  105. set_str(text_w%,it_more%,"")
  106. openit(text_w%)
  107. next_line(p%)
  108.  ?p%>13:p%+=1:
  109. Z    =p%+1
  110. set_num(w%,i%,v%)
  111. ]5!blk2%=w%:blk2%!4=i%:
  112. "Wimp_GetIconState",,blk2%
  113. ^Gblk2%!8=0:blk2%!12=0:$(blk2%!28)=
  114. (v%):
  115. "Wimp_SetIconState",,blk2%
  116. set_str(w%,i%,s$)
  117. b5!blk2%=w%:blk2%!4=i%:
  118. "Wimp_GetIconState",,blk2%
  119. cDblk2%!8=0:blk2%!12=0:$(blk2%!28)=s$:
  120. "Wimp_SetIconState",,blk2%
  121. get_str(w%,i%)
  122. g5!blk2%=w%:blk2%!4=i%:
  123. "Wimp_GetIconState",,blk2%
  124. h*I%=(blk2%!28):
  125.  ?I%>31:I%+=1:
  126. :?I%=13
  127. =$(blk2%!28)
  128. get_num(w%,i%)
  129. l5!blk2%=w%:blk2%!4=i%:
  130. "Wimp_GetIconState",,blk2%
  131. m*I%=(blk2%!28):
  132.  ?I%>31:I%+=1:
  133. :?I%=13
  134. ($(blk2%!28))
  135. setcaret(w%,i%)
  136. q5!blk2%=w%:blk2%!4=i%:
  137. "Wimp_GetIconState",,blk2%
  138. "Wimp_SetCaretPosition",w%,i%,,,-1,
  139. $(blk2%!28)
  140. get_opt(w%,i%)
  141. !blk2%=w%:blk2%!4=i%
  142.  "Wimp_GetIconState",,blk2%
  143.  (blk2%!24
  144. 1<<21):=
  145. ticked(m%,i%)
  146.  (!(m%+28+(24*i%)))
  147. 1=1:=
  148. wkspc(sz%)
  149. "Wimp_SlotSize",memsz%+sz%,-1 
  150.  e%<(memsz%+sz%):=
  151. main_menu
  152.  line,tick,last,write,m%
  153. "tick=1:line=2:write=4:last=&80
  154.  menubuff% &100
  155. m%=menubuff%
  156. *main_m%=
  157. new_menu(m%,"Archive CD",240)
  158. menu_item("Info",line,info_w%)
  159. menu_item("Introduction",0,0)
  160. menu_item("What's on it",0,0)
  161. menu_item("Copyright",0,0)
  162. menu_item("Archive",0,0)
  163. menu_item("Why a CD?",0,0)
  164. menu_item("Subscribing",line,0)
  165. menu_item("Quit",last,0)
  166. new_menu (a%,menutitle$,menuwidth%)
  167. A$a%=menutitle$:a%!12=&70207:a%!16=menuwidth%:a%!20=40:a%!24=0
  168. m%=a%+28
  169. menu_item (itemname$,menuflags%,submenu%)
  170. A!m%=menuflags%:m%!4=submenu%:m%!8=&7000001:$(m%+12)=itemname$
  171. =m%+24
  172. indirect (indir$,flags%,indir%)
  173. C!m%=flags%:m%!4=0:m%!8=&7000101:m%!12=indir%:m%!16=-1:m%!20=127
  174.  indir$ <>"?" $indir%=indir$
  175. =m%+24
  176. shade (m%,i%)
  177. ,!(m%+36+(24*i%))=!(m%+36+(24*i%))
  178.  1<<22
  179. unshade (m%,i%)
  180. 0!(m%+36+(24*i%))=!(m%+36+(24*i%))
  181.  (1<<22)
  182. iconbar (sprite$,pos%)
  183. ,!blk%=pos%:blk%!4=-8:blk%!8=0:blk%!12=56
  184. 3blk%!16=96:blk%!20=&2002:$(blk%+24)="!"+sprite$
  185.  "Wimp_CreateIcon",,blk% 
  186. report_error(err$,fatal%)
  187. "Hourglass_Smash":mask%=&C31
  188. 3!blk2%=
  189. :$(blk2%+4)="Error "+
  190. )+": "+err$++
  191.  "Wimp_ReportError",blk2%,1,title%
  192.  fatal% 
  193.  "Wimp_CloseDown",taskhandle%,&4B534154
  194. alert(op%,a$)
  195. $blk2%!&80=0:$(blk2%+&84)=a$+
  196. "Wimp_ReportError",blk2%+&80,16
  197. op%,title% 
  198.  ,op%
  199. message(num%)
  200. p%=messages%
  201.  num%>0
  202. :p%+=1:
  203. ?p%<32
  204.  p%+=1:num%-=1
  205. get_next_param(p%)
  206.  ?p%>32:p%+=1:
  207.  ?p%<33:p%+=1:
  208. ($p%)
  209. set_main_text
  210.  p%,c%
  211. p%=t_main%
  212.  c%=0 
  213.  n_main%-1
  214. set_str(main_w%,c%,$p%)
  215. next_line(p%)
  216. load_text
  217. "OS_File",17,app_dir$+".text" 
  218.  F%,,,,L%
  219. 1) <>1 
  220.  0,"Text file not found - unable to continue":
  221.  text% L%+4:E%=text%+L%
  222. "OS_File",16,app_dir$+".text",text%,0:?E%=13
  223. at_main%=0:t_whatson%=0:t_copyright%=0:t_about%=0:t_more%=0:t_even%=0:t_subscribe%=0:t_whycd=0
  224. an_main%=0:n_whatson%=0:n_copyright%=0:n_about%=0:n_more%=0:n_even%=0:n_subscribe%=0:n_whycd=0
  225.  I%=text% 
  226. ?I%=10 ?I%=13
  227. I%=text%
  228.  I%<E%
  229. $I%,4) 
  230.  "MAIN":n_main%=
  231. get_next_param(I%):I%=
  232. next_line(I%):t_main%=I%:
  233.  "ABOU":n_about%=
  234. get_next_param(I%):I%=
  235. next_line(I%):t_about%=I%
  236.  "WHAT":n_whatson%=
  237. get_next_param(I%):I%=
  238. next_line(I%):t_whatson%=I%
  239.  "COPY":n_copyright%=
  240. get_next_param(I%):I%=
  241. next_line(I%):t_copyright%=I%
  242.  "MORE":n_more%=
  243. get_next_param(I%):I%=
  244. next_line(I%):t_more%=I%
  245.  "EVEN":n_even%=
  246. get_next_param(I%):I%=
  247. next_line(I%):t_even%=I%
  248.  "SUBS":n_subscribe%=
  249. get_next_param(I%):I%=
  250. next_line(I%):t_subscribe%=I%:
  251.  "WHYC":n_whycd%=
  252. get_next_param(I%):I%=
  253. next_line(I%):t_whycd%=I%:
  254. next_line(I%)
  255. load_messages
  256. "OS_File",17,app_dir$+".messages" 
  257.  F%,,,,L%
  258. 1) <>1 
  259.  0,"Messages file not found - unable to continue":
  260.  messages% L%+4:E%=messages%+L%
  261. "OS_File",16,app_dir$+".messages",messages%,0:?E%=13
  262. max_message%=0
  263. I%=messages%:J%=I%
  264.  I%<E%
  265.  ?I%=
  266.  ?I%=10 
  267.  ?I%>31:I%+=1:
  268. :I%+=1
  269.   I%+=3
  270. :?J%=?I%:I%+=1:J%+=1:
  271.  ?I%<32
  272.   ?J%=13:I%+=1:J%+=1
  273.   max_message%+=1
  274. templates (indirsz%)
  275.  indir% indirsz%, f_spc% &100:E%=indir%+indirsz%
  276.  "Wimp_OpenTemplate",,app_dir$+".templates"
  277.  "Wimp_LoadTemplate",,buffer%,indir%,E%,-1,"info",0 
  278.  ,,R%
  279.  "Wimp_CreateWindow",,buffer% 
  280.  info_w%
  281.  "Wimp_LoadTemplate",,buffer%,R%,E%,f_spc%,"main",0 
  282.  ,,R%
  283.  "Wimp_CreateWindow",,buffer% 
  284.  main_w%
  285.  "Wimp_LoadTemplate",,buffer%,R%,E%,f_spc%,"text",0 
  286.  ,,R%
  287.  "Wimp_CreateWindow",,buffer% 
  288.  text_w%
  289.  "Wimp_CloseTemplate"
  290. set_str(info_w%,2,program$)
  291. set_str(info_w%,3,version$)
  292. set_str(info_w%,4,cprt$)
  293. set_str(info_w%,8,"For Archive CD")
  294. initialise
  295.  "Wimp_Initialise",200,&4B534154,"Archive" 
  296.  ro%,taskhandle%
  297.  ro%<300 
  298.  0,"This program requires RISC-OS 3 or better":
  299.  blk% &180, blk2% &100, title% 24
  300. $title%="Archive"
  301. memsz%=
  302. -&8000:buffer%=
  303. report_error(
  304. $+" During initialisation",
  305.  "OS_ReadVarVal","Obey$Dir",blk%,256,0,3 
  306.  ,,I%
  307. blk%?I%=13:app_dir$=$blk%
  308. define
  309. load_messages
  310. wkspc(&1000)=
  311. message(0):
  312. templates(&1200)
  313. load_text:
  314. set_main_text
  315. ! icon%=
  316. iconbar("archive",-1)
  317. wkspc(0)
  318. main_menu
  319. define
  320. program$="Archive CD Intro"
  321. ('version$="Version "+version_number$
  322. cprt$="
  323.  David Holden 1996"
  324. mask%=%110000110001
  325. +#im_whatson%=17:im_copyright%=18
  326. ,.im_about%=19:im_subscribe%=20:im_whycd%=21
  327. text_max%=28
  328. more%=
  329. :it_more%=29
  330.