home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The Datafile PD-CD 2
/
DATAFILE_PDCD2.iso
/
utilities2
/
meditate
/
MEditate
/
!MEditate
/
Lunchtime
(
.txt
)
< prev
next >
Wrap
RISC OS BBC BASIC V Source
|
1994-02-07
|
29KB
|
1,600 lines
!MEditate v. 3.31 (c) A.J.Bennett N.Davies 7/2/94
Z=3.31:
6,113,1:
&406c2:
46,290,Gy%,"menuscreen",0,0:
R_%,s_%,Oy%:
Oy%<>0:
V(1):
Py:F%=
("<MagEdit$Dir>.magsystem.MagData"):J$=
#F%:__%=
#F%):J$=
#F%:ky%=
#F%):J$=
#F%:BJ%=
#F%):J$=
#F%:wJ%=
#F%):J$=
#F%:VJ%=
#F%):J$=
#F%:k$=
#F%:J$=
#F%:U%=
#F%):J$=
#F%:Py%=
#F%):J$=
#F%:H%=
#F%):J$=
#F%:s%=
#F%):J$=
#F%):
W%(G_%),G%(G_%),B%(G_%),P%(G_%):
G_%:J$=
#F%:W%(A%)=
#F%):B%(A%)=
#F%):G%(A%)=
#F%):P%(A%)=
#F%):
_y:*fx4,2
*fx225,170
*fx226,190
*fx227,210
((s%-H%)/32)-1:p%=
((Py%-U%)/16):h%=0:
A$(B%*__%),M$(B%*__%):f%=0:
Z$(ky%),Z%(ky%*0.8),M%(ky%*0.8),S%(ky%*0.8),F%(ky%*0.8):
A%(ky%*0.8):C$="":sy%=0:gy%=1:by%=2:jy%=4:Bu%=5:Xu%=7:Qu%=8:H$="":
X_%255,vJ%1023:
S$(__%)
MJ%255,uJ%255,C$(78),W$(78),J$(30):
C%(B%+1):I$="":
Gy%BJ%:
uy%wJ%:
Q%VJ%:!Gy%=BJ%:!uy%=wJ%:!Q%=VJ%:Q%!4=0:Q%!8=16:Q%!12=16:ly%=0:z_%=0:Z_%=
:s$="<MagEdit$Dir>.magsystem":A=(Py%+U%)/2:F%=
(s$+".bannerfile"):ly%=
8,255,s$+".bannerfile",Gy%+4:
ly%>8
F$(ly%)
F$(9)
c(Gy%,ly%):
ly%:F$(A%)=J$(A%):
:DJ%=800:
j_%DJ%:!j_%=DJ%:
8,255,s$+".!pointer",j_%+4:
P$(b_%,12),J%(b_%):
J%(A%):
J%(A%):
P$(A%,b%):
G$(FJ%,3),N%(FJ%):
N%(A%):
N%(A%):
G$(A%,b%):
A_:`y%=
8,5,"<MagEdit$Dir>.articles.check"
Zy%=1
s`y%=
:G$="<MagEdit$Dir>.articles.text":F$="<MagEdit$Dir>.articles.palettes":R$="<MagEdit$Dir>.articles.sprites"
8,5,"<MagEdit$Dir>.^.articles.check"
Zy%=1
y`y%=
:G$="<MagEdit$Dir>.^.articles.text":F$="<MagEdit$Dir>.^.articles.palettes":R$="<MagEdit$Dir>.^.articles.sprites"
11,16)"Please Insert a MAGAZINE DISK into drive 0 and press a key":P=
:*MOUNT 0
8,5,"$.articles.check"
Zy%=1
O`y%=
:G$="$.articles.text":F$="$.articles.palettes":R$="$.articles.sprites"
J(F$+"."+k$):
&406c2:
J("wimppalette "+F$+".!Magpal"):
J(My$):
(My$):
46,36+256,j_%,"ptr_hand",2,0,0,0,0:
46,36+256,j_%,"ptr_cross",2,16,8,0,0:
23,253,254,3,50,115,254,112,48,0:
23,254,126,148,148,116,20,20,126,0:
23,253,0,0,0,0,0,0,0,0:
23,254,0,0,0,0,0,0,0,0:
6,"Save Menufiles","Load Menufile","ASCII to Magtext","Magtext to ASCII","* command","Exit"
7,"Display Info","Add Comment","Add Banner","Assign Menu","Assign Article","Change Next Colours","Change Default Colours"
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"
10,"
","","","","","","","","","
5,"Reposition","Change fg/bg","Change Item","Delete","Centre Item"
1,"Edit Mode On/Off"
4,"Save Article","Load Sprites","Load New Palette","Load New Font"
1,"Formatting Characters On/Off"
3,"1File Options","2Menu Options","6Edit Mode"
3,"1File Options","5Edit Options","6Edit Mode"
3,"7File Options","3Edit Article","8Misc"
Z%,C%,D%:
50,30);"X:";Z%,
60,30);"Y:";C%,:
D%<>0
R_%,s_%,Oy%:
Oy%=0:
A(Fu%,y%,D%):
&40743,(Fu%<<8)+(y%<<16)+(D%<<24):
Z%<Py%
Z%>U%
C%<s%
C%>H%
Z%<G%(1)
Z%>W%(1)
C%<P%(1)
C%>B%(1)
Z%<G%(3)
Z%>W%(3)
C%<P%(3)
C%>B%(3)
Z%<G%(4)
Z%>W%(4)
C%<P%(4)
C%>B%(4)
Z:M%=0:
Z%>Z%(A%)
Z%<S%(A%)
C%>M%(A%)
C%<F%(A%)
M%=A%
M%<>0
Dy(M%):
V(1):
H("Are You Sure That You Want To Quit? (Y/N)",`$):
`$="yes"
J(F$+".!Palette"):*FX25,0
*nodir
C *QUIT
_(1,N_%,Cy%):
L(`%,Sy%)
L(`%,Sy%):Yy%=`%:Uy%=Sy%:
A(0,0,0):
A(255,255,255):
A-(27*8),s%-(32):
;"Menu : ";Ry%;") ";v$:
A-(27*8),s%-(2*32):
;"Root Menu : ";ZJ%:
A-(27*8),s%-(4*32):
;"Number of menu items : ";By%:
U%+50,s%-(6*32):
"Default Foreground Colour : ";Yy%:
U%+50,s%-(7*32)
"Default Background Colour : ";Uy%:
A-(21*16),s%-(20*32):
"- Click To Continue -":
R_%,s_%,Oy%:
Oy%<>0:
_(i_%,
a_%):
46,16+256,Q%,"mbtemp",0,0,991,1280,1023:
A(0,25,120):
0,991,1280,1023:
A(255,255,255):
N%(i_%):
240*(A%-1)+16,1019:
;" ";
G$(i_%,A%),2):
1279-(
$)+1)*16,1019:
4:PJ%=0:Ny%=0:fy%=0:zy%=0:K%=-1:T%=-1:w%=-1:z%=-1
Z%,C%,D%:
C%>=991
D%<>0:
Z%,C%,D%:o_%=(Z%-16)/240+1:
o_%<=N%(i_%)
G$(i_%,o_%),1))
Ny%<>PJ%
PJ%<>0
T(Ny%,240*(o_%-1)+16,920-J%(Ny%)*32+32):PJ%=Ny%:fy%=0:zy%=0
Ny%>0
fy%=zy%:zy%=
((T%+z%+16-C%)/32)*((Z%>K%)*(Z%<K%+w%)):
fy%<>0
fy%<>zy%
fy%<=J%(Ny%)
K%+4,T%+z%+20-(fy%*32),w%-8,-32
zy%<>fy%
zy%>0
zy%<=J%(Ny%)
K%+4,T%+z%+20-(zy%*32),w%-8,-32
D%=0:
Z:a_%=0:
Ny%>0
Z%>K%
Z%<K%+w%
C%>T%
C%<T%+z%
((T%+z%+16-C%)/32)
a_%<0
a_%>J%(Ny%)
a_%=0
46,290,Q%,"mbtemp",0,991:
M("Enter CLI command"):
B(j$,70):
:Z_%=
J(j$):
"Press a key to continue":J=
24,U%;H%;Py%;s%;:
H("SAVE BEFORE QUITING (Y/N)",Ay$):
Ay$="yes"
o *FX25
&406c2:
" Error Number ";
;" at line ";
:*FX25
&406c2:
N(G$,q$,B$):
B$<>"MagTex"
M("This is not a MagText file"):
tND$=q$:
M("Enter a file name"):
B(D$,40):
O(D$)=
M("Invalid filename"):
&406c0:F%=
(G$+"."+q$):
#F%,Z,J$,J$,S%,J$:
#F%,S$(A%):
#F%,A$(A%):
#F%:x%=
(G$+"."+D$):
S%-1:
A$(A%))
(254):
A$(A%),
(A$(A%))-1);
(253):
A$(A%),
(A$(A%))-1)
#x%,A$(A%)
A$(S%-1))<>
(253)
(10);
("settype "+G$+"."+D$+" Text"):
&406c1:
N(G$,q$,B$):
B$<>"Text "
M("This is not a Text file"):
&406c0:S%=1:A$(0)="":M$(0)="":oJ%=1:A$="":U$="":I$="":H$="":
Q(15,0,0,"",M$):S$()=M$:S%=1:A$(0)="":
P(0,p%,15,0,"L",Y$):M$()=Y$:F%=
(G$+"."+q$):
#F%):
}"A$(S%)+=
(253):S%+=1:A$(S%)=""
:A$(S%)=A$(S%)+A$
(A$(S%))=p%
py:S%=S%+1
#(F%)
S%>B%*__%:
A$(S%)+=
(253):S%+=1
&406c1:
O(q$):A$()="":
A$(S%),1)<>" ":A$(S%+1)=
A$(S%),1)+A$(S%+1):A$(S%)=
A$(S%),
(A$(S%))-1):
:A$(S%)=A$(S%)+
(254):
O(D$):
M("Enter a file name"):
B(D$,40):
O(D$)=
M("Invalid filename, Try Again"):
B(D$,40):
O(D$)=
&406c0:x%=
(G$+"."+D$):
#x%,Z:
#x%,U$:
#x%,I$,S%,H$:
#x%,S$(A%):
#x%,A$(A%):
:g$="":
M$(A%)=g$
#x%,""
#x%,M$(A%):g$=M$(A%)
J("SetType "+G$+"."+D$+" MagText"):
&406c1:
&406c0:t%=
:S$()="PAA":F%=
(G$+"."+
M(A_%)):
#F%,Z:
M("This is file is incompatible with this version of the Editor"):
#F%,U$,I$,S%,H$:
#F%,S$(A%):
#F%,A$(A%):
#F%,M$(0):
#F%,M$(A%):
M$(A%)=""
M$(A%)=M$(A%-1)
I$<>""
J("wimppalette "+F$+"."+I$)
H$<>""
J(F$+"."+H$)
U$<>""
(R$+"."+U$):z_%=
8,255,R$+"."+U$,uy%+4
&406c1:
e(R%):aJ%=0:TJ%=
:c_%=
A$(R%),
(253)):
c_%<>
A$(R%)
c_%<>0
A%=S%+1
A$(A%),A$(A%+1):
M$(A%),M$(A%+1):
P(0,p%,
N(R%),
Q(R%),"L",M$):M$(R%+1)=M$:A$(R%+1)=
A$(R%),c_%+1):A$(R%)=
A$(R%),c_%):S%+=1:R%+=1:aJ%+=1
:TJ%=
Z%=R%-aJ%
wy(Z%):
wy(g%):
e_%,Z%,A$:
&406c0:Fy$="":iy%=S%-1:
A$(g%),1))<253
A$(g%)=A$(g%)+
(254)
A$(g%),2):
(A$)<>32
A$,2))=254
JL%=g%:
L%+=1:
L%>S%-1
(A$(L%))>1:D%=
A$(L%)," "):
(A$(L%))-1
GA$(g%)=
A$(g%),
(A$(g%))-1)+
A$(L%),D%)+
(254):A$(L%)=
A$(L%),D%+1)
!L%=g%:
L%-=1:
S(L%)>0:
A$(g%)," "):
(A$(L%))+D%<=
S(L%)+1
A$(L%),1)=
(254)
g%=L%
:e_%=
S(g%):L%=
A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lJ%,Du%,Cy$,
N$):N$=
H(Vu%):N$=N$+
H(Mu%):N$=N$+
H(lJ%):N$=N$+
H(Du%):N$=N$+Cy$:
H(Qy%):=
("A")+Qy%)
U(P$):=
(P$)-
("A")
Q(Hu%,Uu%,Nu%,Sy$,
N$):N$=
H(Hu%):N$+=
H(Uu%):N$+=
H(Nu%):N$+=Sy$:
L(n_%):=
S$(n_%),1))
X(n_%):=
S$(n_%),2,1))
W(n_%):=
S$(n_%),3,1))
K(n_%):=
S$(n_%),4)
G:u%=h%:h%=
((S%-1)/B%):
(S%-1)/B%<>h%
h%+=1
h%>u%
L(u%),
X(u%),0,"",S$(h%))
F_:u_%=
G:W%=1:
U(W%):KJ%=
Z%,C%,q%:
50,30);"X:";Z%,
60,30);"Y:";C%,:
H("This article has been modified. Do you want to save? Y/N",A$):
A$="yes"
M(A_%))
v:A$()="":M$()="":
H$<>""
J(F$+".Large"):H$=""
I$<>""
J("wimppalette "+F$+".!magpal")
S$()="PAA":z_%=0:h%=0:W%=0:
U(H_%):
46,290,Gy%,"menuscreen",0,0:Z_%=
F:Qy%=
L(H_%):D%=
X(H_%):
D%<>Qy%
0,128+D%:
0,Qy%
W(H_%)>0
K(H_%))
5R