home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Archive Magazine 1997
/
ARCHIVE_97.iso
/
_archive
/
archive
(
.txt
)
< prev
next >
Wrap
RISC OS BBC BASIC V Source
|
1997-08-13
|
9KB
|
330 lines
--> Archive CD intro
This program and all documentation
David Holden 1996
version_number$="0.03"
initialise
report_error(
openit(main_w%)
"Wimp_Poll",mask%,blk%
reason%
reason%
"Wimp_OpenWindow",,blk%
"Wimp_CloseWindow",,blk%
click
drag_term
"Wimp_ProcessKey",blk%!24
select
17,18:
blk%!16=0
select
"Wimp_GetPointerInfo",,blk%+&C0:mb%=blk%!&C8:my%=blk%
blk%!4=-1
!blk%
openit(main_w%)
J
2:more%=
open_text(t_whatson%,n_whatson%):more_ptr%=t_whatson%
!9
3:more%=
open_text(t_copyright%,n_copyright%)
"1
4:more%=
open_text(t_about%,n_about%)
#1
5:more%=
open_text(t_whycd%,n_whycd%)
$9
6:more%=
open_text(t_subscribe%,n_subscribe%)
mb%=1
"Wimp_CreateMenu",,main_m%,mx%,mh%
click
icn%,win%
"Wimp_GetPointerInfo",,blk%+&C0:mb%=blk%!&C8:my%=blk%!&C4
win%=blk%!12:icn%=blk%!16
win%
icn%=icon%
mb%
2#
openit(main_w%)
3P
2:mx%=blk%!&C0-120:mh%=464:
"Wimp_CreateMenu",,main_m%,mx%,mh%
main_w%:
icn%
7_
im_whatson%:more%=
open_text(t_whatson%,n_whatson%):more_ptr%=t_whatson%
8P
im_copyright%:more%=
open_text(t_copyright%,n_copyright%)
9D
im_about%:more%=
open_text(t_about%,n_about%)
:P
im_subscribe%:more%=
open_text(t_subscribe%,n_subscribe%)
;D
im_whycd%:more%=
open_text(t_whycd%,n_whycd%)
text_w%:
icn%=it_more%
>
more_ptr%
?U
t_whatson%:more_ptr%=t_more%:more%=
open_text(t_more%,n_more%)
@S
t_more%::more_ptr%=t_even%:more%=
open_text(t_even%,n_even%)
A\
t_even%::more_ptr%=t_whatson%:more%=
open_text(t_whatson%,n_whatson%)
openit(w%)
G,!blk2%=w%:
"Wimp_GetWindowState",,blk2%
H%blk2%!20=0:blk2%!24=0:blk2%!28=-1
"Wimp_OpenWindow",,blk2%
open_text(p%,n%)
p%=0
p%=0
c%=0
n%-1
set_str(text_w%,c%,$p%)
next_line(p%)
c%<=text_max%:
set_str(text_w%,c%,""):c%+=1:
more%=
set_str(text_w%,it_more%,
message(1))
set_str(text_w%,it_more%,"")
openit(text_w%)
next_line(p%)
?p%>13:p%+=1:
Z =p%+1
set_num(w%,i%,v%)
]5!blk2%=w%:blk2%!4=i%:
"Wimp_GetIconState",,blk2%
^Gblk2%!8=0:blk2%!12=0:$(blk2%!28)=
(v%):
"Wimp_SetIconState",,blk2%
set_str(w%,i%,s$)
b5!blk2%=w%:blk2%!4=i%:
"Wimp_GetIconState",,blk2%
cDblk2%!8=0:blk2%!12=0:$(blk2%!28)=s$:
"Wimp_SetIconState",,blk2%
get_str(w%,i%)
g5!blk2%=w%:blk2%!4=i%:
"Wimp_GetIconState",,blk2%
h*I%=(blk2%!28):
?I%>31:I%+=1:
:?I%=13
=$(blk2%!28)
get_num(w%,i%)
l5!blk2%=w%:blk2%!4=i%:
"Wimp_GetIconState",,blk2%
m*I%=(blk2%!28):
?I%>31:I%+=1:
:?I%=13
($(blk2%!28))
setcaret(w%,i%)
q5!blk2%=w%:blk2%!4=i%:
"Wimp_GetIconState",,blk2%
"Wimp_SetCaretPosition",w%,i%,,,-1,
$(blk2%!28)
get_opt(w%,i%)
!blk2%=w%:blk2%!4=i%
"Wimp_GetIconState",,blk2%
(blk2%!24
1<<21):=
ticked(m%,i%)
(!(m%+28+(24*i%)))
1=1:=
wkspc(sz%)
"Wimp_SlotSize",memsz%+sz%,-1
e%<(memsz%+sz%):=
main_menu
line,tick,last,write,m%
"tick=1:line=2:write=4:last=&80
menubuff% &100
m%=menubuff%
*main_m%=
new_menu(m%,"Archive CD",240)
menu_item("Info",line,info_w%)
menu_item("Introduction",0,0)
menu_item("What's on it",0,0)
menu_item("Copyright",0,0)
menu_item("Archive",0,0)
menu_item("Why a CD?",0,0)
menu_item("Subscribing",line,0)
menu_item("Quit",last,0)
new_menu (a%,menutitle$,menuwidth%)
A$a%=menutitle$:a%!12=&70207:a%!16=menuwidth%:a%!20=40:a%!24=0
m%=a%+28
menu_item (itemname$,menuflags%,submenu%)
A!m%=menuflags%:m%!4=submenu%:m%!8=&7000001:$(m%+12)=itemname$
=m%+24
indirect (indir$,flags%,indir%)
C!m%=flags%:m%!4=0:m%!8=&7000101:m%!12=indir%:m%!16=-1:m%!20=127
indir$ <>"?" $indir%=indir$
=m%+24
shade (m%,i%)
,!(m%+36+(24*i%))=!(m%+36+(24*i%))
1<<22
unshade (m%,i%)
0!(m%+36+(24*i%))=!(m%+36+(24*i%))
(1<<22)
iconbar (sprite$,pos%)
,!blk%=pos%:blk%!4=-8:blk%!8=0:blk%!12=56
3blk%!16=96:blk%!20=&2002:$(blk%+24)="!"+sprite$
"Wimp_CreateIcon",,blk%
report_error(err$,fatal%)
"Hourglass_Smash":mask%=&C31
3!blk2%=
:$(blk2%+4)="Error "+
)+": "+err$++
"Wimp_ReportError",blk2%,1,title%
fatal%
"Wimp_CloseDown",taskhandle%,&4B534154
alert(op%,a$)
$blk2%!&80=0:$(blk2%+&84)=a$+
"Wimp_ReportError",blk2%+&80,16
op%,title%
,op%
message(num%)
p%=messages%
num%>0
:p%+=1:
?p%<32
p%+=1:num%-=1
get_next_param(p%)
?p%>32:p%+=1:
?p%<33:p%+=1:
($p%)
set_main_text
p%,c%
p%=t_main%
c%=0
n_main%-1
set_str(main_w%,c%,$p%)
next_line(p%)
load_text
"OS_File",17,app_dir$+".text"
F%,,,,L%
1) <>1
0,"Text file not found - unable to continue":
text% L%+4:E%=text%+L%
"OS_File",16,app_dir$+".text",text%,0:?E%=13
at_main%=0:t_whatson%=0:t_copyright%=0:t_about%=0:t_more%=0:t_even%=0:t_subscribe%=0:t_whycd=0
an_main%=0:n_whatson%=0:n_copyright%=0:n_about%=0:n_more%=0:n_even%=0:n_subscribe%=0:n_whycd=0
I%=text%
?I%=10 ?I%=13
I%=text%
I%<E%
$I%,4)
"MAIN":n_main%=
get_next_param(I%):I%=
next_line(I%):t_main%=I%:
"ABOU":n_about%=
get_next_param(I%):I%=
next_line(I%):t_about%=I%
"WHAT":n_whatson%=
get_next_param(I%):I%=
next_line(I%):t_whatson%=I%
"COPY":n_copyright%=
get_next_param(I%):I%=
next_line(I%):t_copyright%=I%
"MORE":n_more%=
get_next_param(I%):I%=
next_line(I%):t_more%=I%
"EVEN":n_even%=
get_next_param(I%):I%=
next_line(I%):t_even%=I%
"SUBS":n_subscribe%=
get_next_param(I%):I%=
next_line(I%):t_subscribe%=I%:
"WHYC":n_whycd%=
get_next_param(I%):I%=
next_line(I%):t_whycd%=I%:
next_line(I%)
load_messages
"OS_File",17,app_dir$+".messages"
F%,,,,L%
1) <>1
0,"Messages file not found - unable to continue":
messages% L%+4:E%=messages%+L%
"OS_File",16,app_dir$+".messages",messages%,0:?E%=13
max_message%=0
I%=messages%:J%=I%
I%<E%
?I%=
?I%=10
?I%>31:I%+=1:
:I%+=1
I%+=3
:?J%=?I%:I%+=1:J%+=1:
?I%<32
?J%=13:I%+=1:J%+=1
max_message%+=1
templates (indirsz%)
indir% indirsz%, f_spc% &100:E%=indir%+indirsz%
"Wimp_OpenTemplate",,app_dir$+".templates"
"Wimp_LoadTemplate",,buffer%,indir%,E%,-1,"info",0
,,R%
"Wimp_CreateWindow",,buffer%
info_w%
"Wimp_LoadTemplate",,buffer%,R%,E%,f_spc%,"main",0
,,R%
"Wimp_CreateWindow",,buffer%
main_w%
"Wimp_LoadTemplate",,buffer%,R%,E%,f_spc%,"text",0
,,R%
"Wimp_CreateWindow",,buffer%
text_w%
"Wimp_CloseTemplate"
set_str(info_w%,2,program$)
set_str(info_w%,3,version$)
set_str(info_w%,4,cprt$)
set_str(info_w%,8,"For Archive CD")
initialise
"Wimp_Initialise",200,&4B534154,"Archive"
ro%,taskhandle%
ro%<300
0,"This program requires RISC-OS 3 or better":
blk% &180, blk2% &100, title% 24
$title%="Archive"
memsz%=
-&8000:buffer%=
report_error(
$+" During initialisation",
"OS_ReadVarVal","Obey$Dir",blk%,256,0,3
,,I%
blk%?I%=13:app_dir$=$blk%
define
load_messages
wkspc(&1000)=
message(0):
templates(&1200)
load_text:
set_main_text
! icon%=
iconbar("archive",-1)
wkspc(0)
main_menu
define
program$="Archive CD Intro"
('version$="Version "+version_number$
cprt$="
David Holden 1996"
mask%=%110000110001
+#im_whatson%=17:im_copyright%=18
,.im_about%=19:im_subscribe%=20:im_whycd%=21
text_max%=28
more%=
:it_more%=29