MY PROGRAMS
SpSheet
PROGRAM
BIN_PROG_1
PFILE:BOQX58RF.BAS
=
E
=
E
=
+z500
dY
nP
xN1=("Version 1.0")
N=("** Spread Sheet **")
)i((238-N)/2-9,10)-((238+N)/2+5,34),S,BF
(i((238-N)/2-7,8)-((238+N)/2+7,32),R,BF
'Q(238-N)/2,1:`("** Spread Sheet **")
!Q(238-N1)/2,2:`("Version 1.0")
)i((238-N)/2-5,10)-((238+N)/2+5,30),X,BF
'i((238-N)/2-7,8)-((238+N)/2+7,32),S,B
N=("Alejandro de la Fuente")
+Q(238-N)/2,4:`("Alejandro de la Fuente")
!N=("A.Fuente@Sheffield.ac.uk")
-Q(238-N)/2,5:`("A.Fuente@Sheffield.ac.uk")
)N=("http://www.shefield.ac.uk/~me1ad")
5Q(238-N)/2,6:`("http://www.shefield.ac.uk/~me1ad")
*
Q200,6:`("[ENTER]"):*0
e
;NC=5:X=1:Y=1:XX=0:YY=0:MX=5:MY=10:FE=0:SAVED=1:RC=0:FN$=""
0DA$(MX-1,MY-1)*45
0DA(MX-1,MY-1)
0V$(3)*100
0ST(100):PARSE=1
0CB$(0)*50
b 100:Y
b1000:Y
b1400:Y
b^1200:Y
b 100:Y
XZ
Y
*i(80,20)-(150,40),S,BF
4i(81,19)-(151,39),R,BF
>i(81,19)-(151,39),S,B
HQ84,2:RC=1
R`"Calculating..."
\
WT=1RMY
fWTT=1RMX
p#XV$(0)=DA$(TT-1,T-1):b5000:Y
zXDA(TT-1,T-1)=(V$(0))
VV$(0)="Rec.Error"T+950
[TT
i(90,35)-(90+(50*T)/MY,35)
[T
XRC=0:e
i(82,20)-(150,38),R,BF
#Q84,2:`"Rec.ERROR":XV$(0)=(1)
XTT=MY+1:XT=MX+1:+b900
P:Y
WT=1R6:Q1,T:`(YY+T):[T
6i(0,0)-(238,69),B:i(10,0)-(10,69):i(0,10)-(238,10)
7WT=1RNC-1:i((228*T)/NC+10,0)-((228*T)/NC+10,69):[T
0WT=0RNC-1:Q(228/NC)*T+13,0:`(65+XX+T):[T
WT=0R5
$
WTT=0RNC-1
.-Q(228/NC)*TT+12,T+1:XV$(0)=DA$(TT+XX,T+YY)
3-V(V$(0),1)="="T`DA(TT+XX,T+YY)v`V$(0)
8[TT
B[T
e
XA$=(1)
XA=(A$):b1400:Y
9VA=14TVX1TX=X-1:vVXX>0TXX=XX-1:b1000:Y
3VA=4TVY>1TY=Y-1:vVYY>0TYY=YY-1:b1000:Y
6VA=5TVY<6TY=Y+1:vVYYMX-NCTXX=MX-NC
(VA=6TYY=YY-6:VYY<0TYY=0
2"VA=7TYY=YY+6:VYY>MY-6TYY=MY-6
<%VA=6A=7A=65A=90Tb1000:Y
FVA=31Tb(10000:Y
ZY
d
b1400:Y
n
+^1200
x4i(11+(X-1)*228/NC,1+Y*10)-(9+X*228/NC,9+Y*10),X,BF
e
@Z
Y
i(80,20)-(150,40),S,BF
i(81,19)-(151,39),R,BF
i(81,19)-(151,39),S,B
Q84,2
*a"Entry :",V$(0):V(V$(0))=""T+
S2080
SAVED=0:b
i2100:Y
XDA$(X+XX-1,Y+YY-1)=V$(0)
U+
U2300
b5000:Y
U+0
VSP>1Tb2200:Y
XDA(X+XX-1,Y+YY-1)=(V$(0))
0VV$(0)="Rec.Error"TXDA$(X+XX-1,Y+YY-1)=V$(0)
U+0
b1000:Y
*e
4XFIN=(V$(0))
9WT=1RFIN
>4V(V$(0),T,1)<>"$"(V$(0),T,1)<>"#"T+2150
COV(V$(0),T+3,1)=" "TXV$(0)=(V$(0),T+1)+"0"+(V$(0),FIN-(T+1)):+G2125
H1VFIN=T+2TXV$(0)=(V$(0),T+1)+"0"+(V$(0),1)
MV((V$(0),T+1,1))>=("a")((V$(0),T+1,1))<=("z")TXV$(0)=(V$(0),T)+(("A")+((V$(0),T+1,1))-("a"))+(V$(0),FIN-(T+1))
R^V((V$(0),T+1,1))-64>MX((V$(0),T+1,1))-65<0TXT=FIN+1:XV$(0)="Bad Ref.":+2155
WZV((V$(0),T+2,2))>MY-1((V$(0),T+2,2))<0TXT=FIN+1:XV$(0)="Bad Ref.":+2155
fXFIN=(V$(0))
k[T
pe
Y
i(80,20)-(150,40),S,BF
i(81,19)-(151,39),R,BF
i(81,19)-(151,39),S,B
Q84,2:*
`"Stack ERROR !!!":*0
XDA$(X+XX-1,Y+YY-1)=""
e
Y
i(80,20)-(150,40),S,BF
i(81,19)-(151,39),R,BF
i(81,19)-(151,39),S,B
$
Q84,2:*
.`"ERROR !!!":*0
8XDA$(X+XX-1,Y+YY-1)=""
B
E2075
VZ
Y
i(80,20)-(150,40),S,BF
i(81,19)-(151,39),R,BF
i(81,19)-(151,39),S,B
Q84,2
a"N. of Columns: ",D$
XD=(D$):VD>MXTXD=MX
VD>10D<1Tb1000:e
XNC=D:b1000:Y
e
Y
V(V$(0),1)<>"="Te
@V(V$(0),1)<>" "TXV$(0)=(V$(0),(V$(0))-1)+" ":+P5030
XV$(0)=(V$(0),(V$(0))-1)
XFIN=V$(0)
XRE=0
WJ=1RFIN
=V(V$(0),J,1)="$"(V$(0),J,1)="#"Tb5500:XJ=FIN+10
VRE=1TXV$(0)="Rec.Error":e
[J
VJ>(FIN+1)T+P5030
PY
ZXSP=0:XLAST=1
dFIN=V$(0)
nWJ=1RFIN
x"V(V$(0),J,1)=" "TbQ5700:Y
[J
bQ5700:Y
XV$(0)=(ST(SP-1))
e
|Y
BXXJ=((V$(0),J+1,1))-65:VXJ>MX-1XJ<0TXV$(0)="0":FIN=0:e
AXYJ=((V$(0),J+2,2))-1:VYJ>MY-1YJ<0TXV$(0)="0":FIN=0:e
VDA$(XJ,YJ)=""T+5555
VRC=0T+5530
VYJMX-1XJ<0TXFIN=0:bS6200:e
BXYJ=((V$(0),J+2,2))+DY:VYJ>MX-1YJ<0TXFIN=0:bS6200:e
JXV$(0)=(V$(0),J-1)+"#"+(XJ)+("0"+(YJ),2)+" "+(V$(0),FIN-(J+3))
XFIN=V$(0):e
8i(80,20)-(170,40),S,BF
Bi(81,19)-(171,39),R,BF
Li(81,19)-(171,39),S,B
VQ84,2
`/`"Check References!":XV$(0)=(1):XV$(0)=""
je
XY
bi(0,0)-(55,68),R,BF
li(0,0)-(55,68),S,B
vQ2,0:`" FILE "
Q2,1:`"1.Open "
Q2,2:`"2.Save "
Q2,3:`"3.Directory "
Q2,5:`"4.Exit "
XA$=(1)
XA=(A$)
VA$="4"A$="E"TA=255:e
'VA$="3"A$="D"Tb/12000:+7200
&VA$="1"A$="O"Tb8500:+7200
&VA$="2"A$="S"Tb8000:+7200
VA=15T+7500
VA=14T+7300
b1000:XA=0:XA$="":e
Y
Q2,0:`" COMMS "
Q2,1:`"1.Download "
Q2,2:`"2.Upload "
"Q2,3:`" "
Q2,5:`" "
XA$=(1)
XA=(A$)
&VA$="1"A$="D"Tb#T9000:+7200
&VA$="2"A$="U"Tb&9500:+7200
VA=15T+7030
VA=14T+7500
+7200
LY
QQ2,0:`" OPTIONS "
VQ2,1:`"1.Columns "
`Q2,2:`"2.Cells "
j#Q2,3:`" "
tQ2,5:`" "
~XA$=(1)
XA=(A$)
%VA$="1"Tb
2500:XA=0:XA$="":e
&VA$="2"Tb*\10500:XA=0:XA$="":e
VA=15T+7300
VA=14T+7030
+7200
@Y
Ji(80,10)-(150,40),S,BF
Ti(81,09)-(151,39),R,BF
^i(81,09)-(151,39),S,B
h$Q84,1:XD$="":`" SAVE":Q84,2
r-a"Filename: ",D$:VD$=""Te:vXD$="E:"+D$
tU+G8300
uXFE=1:XD1$=""
w
!D$Was#1
x"
yU+0
z!VFE=1Tb8200:VD1$<>"Y"Te
{VFE=2T+8000
|Q10,6:`D$:!D$Wqs#1
dP:i(80,20)-(150,40),S,BF:i(81,19)-(151,39),R,BF:i(81,19)-(151,39),S,B:Q84,2:`"Saving File..."
`#1,MX:`#1,MY:`#1,NC
`#1,0:`#1,0:Y
WT=1RMY
WTT=1RMX
`#1,DA$(TT-1,T-1)
[TT
i(90,35)-(90+(50*T)/MY,35)
[T
XSAVED=1:XFN$=(D$,(D$)-2)
"#1
b8350:Y
e
i(80,20)-(170,50),S,BF:Y
i(81,19)-(171,49),R,BF
i(81,19)-(171,49),S,B
&Q84,2
0/`"File Exists!":Q84,3:`"Overwrite (y/n) ?";
:XD1$=(1)
D
XFE=0:e
lXFE=0
qi(80,10)-(150,40),S,BF
!Hi(81,09)-(151,39),R,BF
!Ri(81,09)-(151,39),S,B:D$=""
!W"!\$Q84,1:XD$="":`" OPEN":Q84,2
!f-a"Filename: ",D$:VD$=""Te:vXD$="E:"+D$
!kU+!8700
!p
!D$Was#1
!r2i(81,19)-(151,39),S,B:Q84,2:`"Opening File..."
!s:DA$
!ta#1,MX:a#1,MY
!u0DA$(MX-1,MY-1)*45
!v:DA
!w0DA(MX-1,MY-1)
!ya#1,NC
!za#1,D:a#1,D:Y
!
WT=1RMY
!WTT=1RMX
!a#1,DA$(TT-1,T-1)
![TT
!i(90,35)-(90+(50*T)/MY,35)
![T
! XSAVED=1:XFN$=(D$,(D$)-2)
!"
!U+0
!P:bi800:Y
!U+0
!e
!i(80,20)-(170,50),S,BF
"i(81,19)-(171,49),R,BF
"i(81,19)-(171,49),S,B
"Q84,2
"$)V=94T`" File not found":+#+8780
".(V=95T`" Bad file name":+#+8780
"3*V<>60T+"8775v`" Out of memory"
"5XMX=5:XMY=10
"80DA$(MX-1,MY-1)*45
"=0DA(MX-1,MY-1)
"B
+#+8780
"G+`"Unknown ERROR !":Q84,3:`" ";;",";
"LXA$=(1):XA$=""
"[
!8628
"^Z
#(Y
#-b713000:Y
#2i(80,20)-(150,40),S,BF
#<i(81,19)-(151,39),R,BF
#Fi(81,19)-(151,39),S,B
#PQ84,2
#Z`"Downloading..."
#_U+$9200
#d!"COM:C,&H1A"s#1
#ia#1,MX:a#1,MY
#k:DA$
#n:DA
#q0DA$(MX-1,MY-1)*45
#s0DA(MX-1,MY-1)
#
WT=1RMY
#WTT=1RMX
#a#1,DA$(TT-1,T-1)
#[TT
#i(90,35)-(90+(50*T)/MY,35)
#[T
#XSAVED=0:XNC=MX
#"
#U+0
#P:bi800:Y
#e
#i(80,20)-(170,50),S,BF
#i(81,19)-(171,49),R,BF
$i(81,19)-(171,49),S,B
$Q84,2
$'V<>60T+%9265v`"Out of memory"
$XMX=5:XMY=10:XNC=5
$0DA$(MX-1,MY-1)*45
$0DA(MX-1,MY-1)
$"
+%9267
$1`"Unknown ERROR !"
$3Q84,3:`" ";;" ";:*
$6`"[ENTER]":*0
$@
$9160
$JZ
%Y
%&i(60,20)-(180,40),S,BF
%0i(61,19)-(181,39),R,BF
%:i(61,19)-(181,39),S,B
%DOQ64,2:`"Formulae or numbers (F/N)?":XA$=(1):VA$<>"F"A$<>"N"T+&t9540
%N0i(62,20)-(180,38),R,BF:Q64,2:`"Uploading..."
%X!"COM:C,&H1A"s#1
%b"`#1,(MX)+",";:`#1,(MY)+",";
%
WT=1RMY
%WTT=1RMX
%"VA$="F"T`#1,DA$(TT-1,T-1)+",";
%\VA$="N"TV(DA$(TT-1,T-1),1,1)="="T`#1,(DA(TT-1,T-1))+",";:v`#1,DA$(TT-1,T-1)+",";
%[TT
%i(70,35)-(70+(100*T)/MY,35)
%[T
%"#1
%e
'Y
'i(0,0)-(55,68),R,BF
'$i(0,0)-(55,68),S,B
'.Q2,0:`" EDIT "
'8Q2,1:`"X.Cut "
'BQ2,2:`"C.Copy "
'LQ2,3:`"V.Paste "
'VQ2,4:`"R.Recalc. "
'tXA$=(1)
'XA=(A$)
']VA$="X"TXCX=X+XX-1:XCY=Y+YY-1:XCB$(0)=DA$(CX,CY):XDA$(CX,CY)="":XSAVED=0:b1000:e
'CVA$="C"TXCX=X+XX-1:XCY=Y+YY-1:XCB$(0)=DA$(CX,CY):b1000:e
'VA$="V"TXV$(0)=CB$(0):b6000:VV$(0)<>""TXDA$(X+XX-1,Y+YY-1)=V$(0):b5000:XDA(X+XX-1,Y+YY-1)=(V$(0)):b1000:e
' VA$="R"Tbi800:b1000:e
'b1000:XA=0:XA$="":e
)Y
)i(80,20)-(170,55),S,BF
)i(81,19)-(171,54),R,BF
)"i(81,19)-(171,54),S,B
),Q84,2
)6?a"N.Rows :";NR$:i(81,19)-(171,54),S,B:V(NR$)<6TXNR$="6"
)@FQ84,3:a"N.Cols :";NC$:i(81,19)-(171,54),S,B:V(NC$)<1TXNC$="1"
)TVSAVED=1T+,M10700
)Y
XSAVED=0
)^%V(NR$)>MY(NC$)>MXT+,M10700
)hi(82,20)-(170,53),R,BF
)rQ84,2
)|-`"Part of the data":Q84,3:`"will be lost"
)Q84,4:`"Continue (y/n) ?"
)XA$=(1)
)VA$="Y"T+,M10700
)b1000:XA=0:XA$="":e
)i(82,20)-(170,53),R,BF
)Q84,2
)`"Resizing ..."
)U+.10900
)!"E:sptmp"Wqs#1
)
WT=1RMY
)WTT=1RMX
*`#1,DA$(TT-1,T-1)
*[TT
*
i(90,35)-(90+(25*T)/MY,35)
*[T
*"
*:DA$
*!:DA
*&0DA$((NC$)-1,(NR$)-1)*45
*+0DA((NC$)-1,(NR$)-1)
*0!"E:sptmp"Was#1
*D
WT=1RMY
*IWTT=1RMX
*Na#1,V$(0)
*P1VTT<=(NC$)T<=(NR$)TXDA$(TT-1,T-1)=V$(0)
*S[TT
*Xi(90,35)-(115+(25*T)/MY,35)
*][T
*b"
*d+XMY=(NR$):XMX=(NC$):VNC>MXTXNC=MX
*eXXX=0:XYY=0:XX=1:XY=1
*gU+0
*i<"E:sptmp"
*l'P:bi800:b1000:XA=0:XA$="":e
*Y
*i(82,20)-(170,54),R,BF
*Q84,2
*(V<>60T+/10970v`"Out of memory"
*"
*0DA$(MX-1,MY-1)*45
*0DA(MX-1,MY-1)
*!"E:sptmp"Was#1
*
WT=1RMY
*WTT=1RMX
*a#1,DA$(TT-1,T-1)
*[TT
*i(90,35)-(115+(50*T)/MY,35)
*[T
*"
*.W10855
*`"Unknown ERROR !"
*
Q84,3:*
*`"[ENTER]":*0
*.10850
*Z
.Y
.P:XFIN=0:"
.U+612900
.!"E:spdir0"Was#1
.:DIR$
.0DIR$(20)
.
WTT=0R2
/ WT=0R6
/,V(1)<>0TXTT=4:XT=6:XFIN=1:+012070
/
a#1,DIR$(T+TT*7)
/QTT*48,T:`DIR$(T+TT*7)
/!V(1)<>0TXTT=4:XT=6:XFIN=1
/&[T
/0[TT
/:
XT=0:XTT=0
/Di(195,0)-(238,68),R,BF
/Ni(195,0)-(238,68),S,B
/bQ198,0:`"O.Open"
/lQ198,1:`"S.Save"
/vQ198,2:`"D.Delete"
/Q198,5:`"E.Exit"
/VFIN=0TQ198,3:`"N.Next "
/VFIN=1TQ198,3:`"F.First "
/b412500:Y
/XA$=(1)
/XA=(A$):b412500:Y
/VA=14TVT<2TXT=T+1
/VA=15TVT>0TXT=T-1
/VA=4TVTT>0TXTT=TT-1
/VA=5TVTT<6TXTT=TT+1
/VA$="O"T+312350
/KVA$="S"DIR$(T*7+TT)<>""TXD$="E:"+DIR$(T*7+TT):":b8052:+/12000
/3VA$="S"DIR$(T*7+TT)=""T":b8000:+/12000
/VA$="E"T+412400
04VA$="D"TVDIR$(T*7+TT)<>""Tb412600:+/12000
0VA$="N"FIN=0T+612800
0VA$="F"FIN=1T+612800
0b412500:Y
0 +112205
0>VDIR$(T*7+TT)=""Te
0AXD2$=DIR$(T*7+TT)
0CXD$="":b713000:Y
0HXD$="":XD$="E:"+D2$
0MGi(80,20)-(150,40),S,BF:i(81,19)-(151,39),R,BF:i(81,19)-(151,39),S,B
0R":b W8555:+/12000
0p"
0uU+0
0z:DIR$
0e
0+i(T*48,TT*10)-((T+1)*48-5,(TT+1)*10),X,BF
0e
18Y
1BXD$=DIR$(T*7+TT)
1DGi(80,20)-(170,40),S,BF:i(81,19)-(171,39),R,BF:i(81,19)-(171,39),S,B
1E4Q84,2:`"Delete ";D$;" ?":XA$=(1):VA$<>"Y"Te
1L"
1QVD$=""Te
1V
<"E:"+D$
1`!"E:spdir0"Was#1
1j!"E:sptmp"Wqs#2
1tV(1)=0a#1,A$
1~VA$<>D$T`#2,A$
1V(1)=0T+512660
1"
1!"E:spdir0"Wqs#1
1!"E:sptmp"Was#2
1V(2)=0Ta#2,A$:`#1,A$
1V(2)=0T+6Q12720
1V(1)=0T":<"E:spdir0"
1"
1<"E:sptmp"
1e
2 VFIN=0T+0S12030
2
"
2+/12000
2dY
2nGi(80,20)-(170,40),S,BF:i(81,19)-(171,39),R,BF:i(81,19)-(171,39),S,B
2xQ84,2
2%V=94T`" Empty !":+712960
2'V=60T`"Out of Memory!":+712960
2`" Error ";;",";;" !"
2XA$=(1)
2!V>12000<13000T412400
2[
2Y
2VSAVED=1Te
2JP:i(60,20)-(190,50),S,BF:i(61,19)-(191,49),R,BF:i(61,19)-(191,49),S,B
2Q64,2
2`"File ";FN$;" not saved !"
2Q84,3:`"Save now (Y/N) ?"
3XA$=(1)
3VA$="N"TP:e
3"
38VFN$<>""TXD$="E:"+FN$:Q10,5:`D$:bJ8060:P:":e
3"
b8000:Y
3'"
3,e
u1Z