home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The Datafile PD-CD 5
/
DATAFILE_PDCD5.iso
/
utilities
/
w
/
wordenter
/
!WordEnter
/
!RunImage
(
.txt
)
< prev
next >
Wrap
RISC OS BBC BASIC V Source
|
1993-08-27
|
7KB
|
290 lines
>!RunImage
A word enterer
NSW 26/08/93
<n$="1.13 (26th August 93)":
$+" at line "+
r:b$=
b$<>""
g(b$)
$+" at line "+
"Wimp_Poll",,c%
"Wimp_RedrawWindow",,c%
"Wimp_OpenWindow",,c%
"Wimp_CloseWindow",,c%
17,18,19:
"Wimp_CloseDown":
i(u%,d%,d%<5):
b(u%):p%=
"Wimp_Poll",,c%
"Wimp_OpenWindow",,c%
c%!16
5:p%=
6:p%=
17,18
a(u%):
d:z%=(A%/50)+1:!a%=i%:
a%!4=3
z%+1:
"Wimp_DeleteIcon",,a%:
:A%=0:C%=-194:B%=aa%:a%!0=_%:a%!4=B%:a%!8=`%:a%!12=ba%:
"Wimp_SetExtent",i%,a%:
a(i%):
b(i%):
g(b$):$L%=b$:g%=
(b$):
a$<>""
f(a$)
#g%:t%=
"Wimp_CreateMenu",,-1:
a(v%):
#-b$="":e%=c%+43:
e%?1<>0:e%+=1:b$+=
a(v%,0)
b$,".",0)=0
d("sav")):
y(b$):M%=
y(b$):g%=
(b$):z%=(A%/50)+1:
ca%=3
z%+1:
a(i%,ca%):
"OS_CLI","SetType "+b$+" 0E6":
u:da%=c%!24:m%=!c%:
da%=13
a(n%)
a(j%)
a(o%)
"Wimp_ProcessKey",da%
j:a$=
a(n%,1):
f(a$):t%=
k:a$=
a(j%,1):
D%,N%:
z%-2:e$=$(D%+e%*50):
e$<>a$
f(e$)
e$<>""
a(j%):t%=
l:l$=f$:o$=
a(o%,1):
D%,N%:
z%-2:e$=$(D%+e%*50):
e$<>l$
f(e$)
e$=l$
f(o$)
e$<>""
a(j%):t%=
z:a$=
a(m%,d%):
m(a$):
m(a$):
"OS_Byte",138,0,
a$,O%):
"win":
e(n%,1,""):
b(n%):
n(n%,1,0)
f$<>""
e(o%,1,f$):
b(o%):
n(o%,1,
f$<>""
e(j%,1,f$):
b(j%)
"bar":
3:K%=
s:x%=!c%:y%=c%!4:ea%=c%!8:m%=c%!12:d%=c%!16:fa%=(m%=-2):
h$="bar":f$=""
h$="win":f$=""
:h$="win":f$=
a(m%,d%)
A(x%,y%)
b(i%)
a(n%)
a(n%)
a(j%)
a(j%)
a(o%)
a(o%)
16,64:
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:
6,161,28
,,f%:
ga%>=310
"DragASprite_Start",197,1,"file_0e6",c%+8,c%+24
"Wimp_DragBox",,c%
o(ha%):d$=
$:c$=
d$,8,3):d$=
d$,5,11):P%=
(d$):
1,21,31:i$="st"
2,22:i$="nd"
3,23:i$="rd"
:i$="th"
"Jan":c$="January"
"Feb":c$="February"
"Mar":c$="March"
"Apr":c$="April"
"May":c$="May"
"Jun":c$="June"
"Jul":c$="July"
"Aug":c$="August"
"Sep":c$="September"
"Oct":c$="October"
"Nov":c$="November"
"Dec":c$="December"
1:d$=
P%+i$+" "+c$+" "+
d$,4)
2:d$=c$+" "+
P%+i$+" "+
d$,4)
m(d$):
A(ia%,ja%):
h$="bar"
ja%=296:k%=h%
h$="win"
k%=h%+200
"Wimp_CreateMenu",,k%,ia%-64,ja%:
c%!16
0:K%=
3,5:ka%=c%!40:
ka%<>230
3b$="":e%=c%+43:
e%?1<>0:e%+=1:b$+=
#c%!20,"Run "+
g("Enter$Dir")
1282:
i(l%,d%,la%):!a%=l%:a%!4=d%:a%!8=0:a%!12=1<<23:
"Wimp_SetIconState",,a%:
C!a%=l%:a%!4=d%:a%!8=1<<23:a%!12=1<<23:
"Wimp_SetIconState",,a%
i(u%,d%,d%>4):
b(u%):p%=
"Wimp_Poll",,c%
"Wimp_OpenWindow",,c%
c%!16
g(b$):p%=
g(b$):p%=
4:p%=
17,18
g(b$)
a(u%):
g(p$):
"OS_ReadVarVal",p$,Q%,255,0,3
,,b%:Q%?b%=13:=$Q%
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:
D% 8000,L% 256,wa% 512,Q% 256,xa% 256,ya% 512,za% 32:
"Wimp_Initialise",200,&4B534154,"Word Enterer"
$pa%="Word Enterer":K%=
:C%=-194:A%=0:Aa%=
:S%=0:T%=0:Ba%=
e(-1,0,0,68,68,12298,"!wordenter",0,0,0):g%=
"<Enter$Dir>.Sprites":U%=
#g%+16:
q% U%:
"OS_SpriteOp",256+10,q%,"<Enter$Dir>.Sprites":
"Wimp_OpenTemplate",,"<Enter$Dir>.Templates":Ca%=
b(ma%,na%,511,"info",q%):i%=
b(r%,oa%,511,"main",q%):o%=
b(ua%,va%,511,"edit",q%):n%=
b(qa%,ra%,511,"edit",q%):j%=
b(sa%,ta%,511,"edit",q%)
b(wa%,L%,255,"save",q%):u%=
b(ya%,xa%,255,"modd",q%):
"Wimp_CloseTemplate":$ra%="Add word":
e(n%,0,"Please enter the word below"):$ta%="Delete word":
e(j%,0,"Are you sure you wish to delete this word?")
$(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:
r:$h%="Word Enterer":h%!12=459271:h%!16=16*13:h%!20=44:h%!24=0:
c(h%+28,0,Ca%,&7091031,"Info"):
c(h%+52,0,v%,&7091031,"Save"):
c(h%+76,0,-1,&7091031,"New file"):
c(h%+100,128,-1,&7091031,"Quit"):k%=h%+200
$k%="Word menu":k%!12=459271:k%!16=16*10:k%!20=44:k%!24=0:
c(k%+28,0,-1,&7091031,"Add"):
c(k%+52,0,-1,&7091031,"Edit"):
c(k%+76,128,-1,&7091031,"Delete"):
f(k$):Ha%=
e(i%,16,C%,654,C%+48,&700313D,"",N%+A%,-1,50):
e(i%,Ha%,k$):C%-=50:A%+=50:
"Wimp_ForceRedraw",i%,Da%,Ea%,Fa%,Ga%:Ea%-=50:Ga%-=50:B%-=50:a%!0=_%:a%!4=B%:a%!8=`%:a%!12=ba%:
"Wimp_SetExtent",i%,a%:
F:g%=
"<Enter$Dir>.Messages":E%=0:
#g%:E%+=1:
a$(E%):
#g%=0:
E%:a$(e%)=
c(F%,Ia%,e%,V%,a$):F%!0=Ia%:F%!4=e%:F%!8=V%:$(F%+12)=a$:
b(Z%,d%,Ja%,m$,Ka%):
$+" whilst trying to load template '"+m$+"'"):
"Wimp_LoadTemplate",,Z%,d%,d%+Ja%,-1,m$,0:Z%!64=Ka%:
"Wimp_CreateWindow",,Z%
s%:=s%
c(q$):La%=S%:S%=
S%-La%<200
T%+=1
"Wimp_CloseDown":
"Wimp_CommandWindow",0:R%!0=255:$(R%+4)=q$:
"Wimp_ReportError",R%,18,pa%
,Ma%:=Ma%
a(l%,d%):!a%=l%:a%!4=d%:
"Wimp_GetIconState",,a%:=$(a%!28)
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%:
Ra%=0
:$(a%+24)=a$:
:a%!24=Ra%:a%!28=Sa%:a%!32=Ta%
"Wimp_CreateIcon",,a%
s%:=s%
a(s%):!a%=s%:
"Wimp_GetWindowState",,a%:a%!28=0:
"Wimp_CloseWindow",,a%:
C:c%!12=c%!8:c%!16=4:
"Wimp_SendMessage",17,c%,c%!4:
b(s%):
G:!a%=s%:
"Wimp_GetWindowState",,a%:
H:Aa%=
&a%!28=-1:
"Wimp_OpenWindow",,a%:
G:a%!0=4:a%!4=5:a%!8=11:a%!12=12:a%!16=-1:
"OS_ReadVduVariables",a%,a%+20:Ua%=1<<(a%!20):Va%=1<<(a%!24):Wa%=(a%!28+1)*Ua%:Xa%=(a%!32+1)*Va%:
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%:
e(l%,d%,k$):!a%=l%:a%!4=d%:
"Wimp_GetIconState",,a%:$(a%!28)=k$:a%!8=0:a%!12=0:
"Wimp_SetIconState",,a%:
n(l%,d%,O%):
"Wimp_SetCaretPosition",l%,d%,-1,-1,-1,O%:
"OS_GetEnv"
(g$)<6
<x%=0:
g$," ",x%)>0:x%=
g$," ",x%)+1:
(g$)-x%+1)
"OS_SWINumberFromString",,"DragASprite_Stop"
"DragASprite_Stop"
"Wimp_DragBox",,0:b%=c%:
"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)=
a(v%,0)):
"Wimp_SendMessage",17,c%,l%,d%:M%=
h(j$):
j$,".")>0:j$=
j$,".")+1):
E:m%=c%!32:d%=c%!36:
d("bar"))
I(a$):U%=
a$+1:c%!12=c%!8:c%!16=1283:$(c%+20)=a$+
0:!c%=(24+U%)
"Wimp_SendMessage",17,c%,c%!4:
d(a$):
E%:e%=
a$(G%),":"):
a$(G%),e%-1):
r$=a$
a$(G%),
a$(G%)-e%)