Home » Personal collection » Acorn hard disk » apps » MultiStore » !MultiStor/BaseLib

!MultiStor/BaseLib

This website contains an archive of files for the Acorn Electron, BBC Micro, Acorn Archimedes, Commodore 16 and Commodore 64 computers, which Dominic Ford has rescued from his private collection of floppy disks and cassettes.

Some of these files were originally commercial releases in the 1980s and 1990s, but they are now widely available online. I assume that copyright over them is no longer being asserted. If you own the copyright and would like files to be removed, please contact me.

Tape/disk: Home » Personal collection » Acorn hard disk » apps » MultiStore
Filename: !MultiStor/BaseLib
Read OK:
File size: 1BED bytes
Load address: 0000
Exec address: 0000
File contents
   10REM > <MultiStore$Dir>.BaseLib
   20REM   By Merlyn Kline for Copyright (c) 1989 Minerva Software
   30
   40REM   BASE functions as described in the manual
   50
   60
   70-BASE FUNCTIONS-------------------------------------------------------
   80
   90DEFFNc="C"+RIGHT$("000000000"+STR$FNv_(15),10)
  100
  110DEFFNsurn(A$):LOCALI%,C%
  120WHILERIGHT$(A$,1)=" ":A$=LEFT$(A$):ENDWHILE:I%=LENA$:C%=ASCMID$(A$,I%)
  130WHILEI%>0AND((C%>64ANDC%<91)OR(C%>96ANDC%<123)ORC%=45):I%-=1
  140C%=ASCMID$(A$,I%):ENDWHILE
  150=MID$(A$,I%+1)
  160
  170DEFFNs(T$):$sd%=T$:SYSswi%,strip_%
  180DEFFNup(T$):$sd%=T$:SYSswi%,upper_%
  190DEFFNu(T$):$sd%=T$:SYSswi%,upper_%
  200DEFFNsu(T$):$sd%=T$:SYSswi%,strip_%:SYSswi%,upper_%
  210=$sd%
  220
  230DEFFNlink(a$,f$,T$)
  240LOCALT%,I%,n%
  250SYSswi%,sd13_%,f$:n%=FNv_(15)
  260SYSswi%,sd45_%,"N",f$
  270SYSswi%,find_%,T$,f$TOG%
  280T%=G%:SYSswi%,sd45_%,"E",f$
  290IFT%>0:SYSswi%,sd13_%:="** No Record **"
  300SYSswi%,gfield_%,a$,f$
  310IFn%<=FNv_(17):SYSswi%,grec_%,n%,f$TON%
  320SYSswi%,sd13_%:=$sd%
  330 
  340DEFFNsearchall(A$):LOCALI%,J%:I%=1:J%=FNv_(7)
  350DEFFNsearch(A$,I%,J%)
  360A$=FNup(A$):WHILEI%<=J%
  370SYSswi%,gfield_%,I%
  380SYSswi%,upper_%
  390IFINSTR($sd%,A$):=TRUE
  400I%+=1:ENDWHILE
  410=FALSE
  420
  430DEFFNpad(T$,T%)
  440T$=LEFT$(FNss(T$),T%):T$+=STRING$(T%-LENT$," ")
  450=T$
  460
  470DEFFNi(A$,B$):IFLENB$>LENA$:=0:ELSE=INSTR(A$,B$)<>0
  480
  490DEFFNnumberth(N):LOCALA$,B$,T$,T%,I%:LOCALDATA
  500T$=FNnumber(N):RESTORE+12
  510T%=0:REPEAT:READA$,A$:T%=T%+1:UNTILA$=RIGHT$(T$,LENA$):RESTORE+13
  520FORI%=1TOT%:READB$:NEXT
  530IFB$="*":=T$+"th":ELSEIFB$="+":=LEFT$(T$,LENT$-1)+"ieth"
  540=LEFT$(T$,LENT$-LENA$)+B$
  550
  560DEFFNnumber(N):LOCALN$,U$,U%,M%:LOCALDATA
  570N$="":IFN<0 N$="minus ":N=ABSN
  580IFN<21 =N$+FNln(N):ELSERESTORE+4:REPEAT:READU%,U$:UNTILU%<=N:M%=N/U%:N=N-M%*U%:IFU%<100ANDN=0 =N$+U$:ELSEIFU%<100 =N$+U$+" "+FNnumber(N):ELSEIFN=0 =N$+FNnumber(M%)+" "+U$:ELSEIFN<1 =N$+FNnumber(M%)+" "+U$+" "+FNnumber(N)
  590IFN<100 =N$+FNnumber(M%)+" "+U$+" and "+FNnumber(N):ELSE=N$+FNnumber(M%)+" "+U$+" "+FNnumber(N)
  600DEFFNln(N):LOCALU%,U$,N$,F$,I%,@%:RESTORE+3:REPEAT:READU%,U$:UNTILU%<=N:IFN-INT(N)<.00001THEN=U$:ELSEN$=LEFT$(U$+" ",U%*5)+"point":@%=&1020518:F$=RIGHT$(STR$(N),5)+"0":REPEATF$=LEFT$(F$,LENF$-1):UNTILRIGHT$(F$,1)<>"0"
  610FORI%=1TOLENF$:N$=N$+" "+FNln(VALMID$(F$,I%,1)):NEXT:=N$
  620DATA1E9,billion,1E6,million,1E3,thousand,100,hundred,90,ninety,80,eighty,70,seventy,60,sixty,50,fifty,40,forty,30,thirty
  630DATA20,twenty,19,nineteen,18,eighteen,17,seventeen,16,sixteen,15,fifteen,14,fourteen,13,thirteen,12,twelve,11,eleven,10,ten,9,nine,8,eight,7,seven,6,six,5,five,4,four,3,three,2,two,1,one,0,zero
  640DATA*,*,*,*,+,+,+,+,+,+,+,+,*,*,*,*,*,*,*,twelfth,*,*,ninth,eighth,*,*,fifth,*,third,second,first,*
  650
  660DEFFNcardinal(T%):IFT%>3ANDT%<20:="th"
  670T%=T%MOD10:=MID$("thstndrdthththththth",T%*2+1,2)
  680
  690DEFFNlower(T$):LOCALI%,C%:IFT$="":=""
  700FORI%=1TOLENT$:C%=ASCMID$(T$,I%)
  710IFC%>64ANDC%<91:MID$(T$,I%,1)=CHR$(C%+32)
  720NEXT:=T$
  730
  740DEFFNss(T$):LOCALT%:REPEATT%=INSTR(T$,"  ")
  750IFT%>0T$=LEFT$(T$,T%-1)+MID$(T$,T%+1)
  760UNTILT%=0:=FNs(T$)
  770
  780DEFFNtidy(T$):=FNcasetrim(T$)
  790
  800DEFFNdays(D%,M%,Y%):IFY%<0ORM%<1ORM%>12:=0
  810IFY%<100Y%+=1900
  820LOCALL%:L%=FNleap(Y%)
  830IFD%<1ORD%>VALMID$("312831303130313130313031",M%*2-1,2)-(L%ANDM%=2):=0
  840=1284095+D%+VALMID$("000031059090120151181212243273304334",M%*3-2,3)+Y%*365+(Y%-1)DIV4-(Y%-1)DIV100+(Y%-1)DIV400-(L%ANDM%>2)
  850
  860DEFFNmon(M%):LOCALT$:LOCALDATA
  870IFM%<1ORM%>12:="Bad Month"
  880RESTORE+1:REPEAT:READT$:M%-=1:UNTILM%=0:=T$
  890DATAJanuary,February,March,April,May,June,July,August,September
  900DATAOctober,November,December
  910
  920DEFFNmon3(M%)=LEFT$(FNmon(M%),3)
  930DEFFNmon4(M%)=LEFT$(FNmon(M%),4)
  940DEFFNmon9(M%)=FNpad(FNmon(M%),9)
  950
  960DEFFNwday(D%):LOCALT$:D%=D%MOD7
  970RESTORE+1:REPEAT:READT$:D%-=1:UNTILD%<0:=T$
  980DATAFriday,Saturday,Sunday,Monday,Tuesday,Wednesday,Thursday
  990
 1000DEFFNwday3(D%)=LEFT$(FNwday(D%),3)
 1010
 1020DEFFNnyear(D%):D%-=1284095:=(D%-(D%-29)DIV1461+(D%-29)DIV36524-(D%-29)DIV146097-1)DIV365
 1030 
 1040DEFFNnmon(D%):LOCALL%,M%
 1050L%=FNnyear(D%):D%=D%-FNdays(1,1,L%):L%=FNleap(L%)
 1060M%=-2:REPEAT:M%+=3
 1070UNTILD%<VALMID$("031059090120151181212243273304334367",M%,3)-(L%ANDM%>3)
 1080=M%DIV3+1
 1090 
 1100DEFFNnday(D%)=D%+1-FNdays(1,FNnmon(D%),FNnyear(D%))
 1110
 1120DEFPROCexpdate(T%,RETURN D%,RETURN M%,RETURN Y%):LOCALL%,U%
 1130Y%=FNnyear(T%):U%=T%-FNdays(1,1,Y%):L%=FNleap(Y%):M%=-2:REPEAT:M%+=3
 1140UNTILU%<VALMID$("031059090120151181212243273304334367",M%,3)-(L%ANDM%>3)
 1150M%=M%DIV3+1:D%=T%+1-FNdays(1,M%,Y%):ENDPROC
 1160
 1170DEFFNsyear(Y%)=" "+RIGHT$("000"+STR$Y%,4)
 1180
 1190DEFFNsmon(M%)=FNmon(M%)
 1200
 1210DEFFNd2(T%)=RIGHT$("0"+STR$T%,2)
 1220
 1230DEFFNleap(Y%)=Y%MOD4=0ANDY%MOD100<>0ORY%MOD400=0
 1240
 1250DEFFNstrdate(U%,M%,Y%,T%):LOCALD%:D%=FNdays(U%,M%,Y%)
 1260DEFFNstrdate1(D%,T%):LOCALU%,M%,Y%:PROCexpdate(D%,U%,M%,Y%)
 1270IFD%<1:="Error!"
 1280CASET%OF
 1290WHEN1:=FNwday(D%)+" "+STR$U%+FNcardinal(U%)+" "+FNsmon(M%)+FNsyear(Y%)
 1300WHEN2:=FNmon3(M%)+" "+RIGHT$("0"+STR$U%,2)+FNsyear(Y%)
 1310WHEN3:=STR$U%+FNcardinal(U%)+" "+FNmon3(M%)+FNsyear(Y%)
 1320WHEN4:=FNwday3(D%)+" "+STR$U%+FNcardinal(U%)+" "+FNmon3(M%)+FNsyear(Y%)
 1330WHEN5:=FNd2(M%)+"/"+FNd2(U%)+"/"+FNd2(Y%)
 1340WHEN6:="The "+FNnumberth(U%)+" day of "+FNsmon(M%)+" in the year of our Lord "+FNnumber(Y%)
 1350WHEN7:=STR$U%+FNcardinal(U%)+" "+FNsmon(M%)+FNsyear(Y%)
 1360WHEN8:="The "+FNcasetrim(FNnumberth(U%))+" day of "+FNsmon(M%)+" in the year of our Lord "+FNcasetrim(FNnumber(Y%))
 1370WHEN10:=FNd2(U%)+FNmon3(M%)+FNd2(Y%)
 1380WHEN11:=FNd2(U%)+FNd2(M%)+FNd2(Y%)
 1390WHEN12:=STR$U%+" "+FNmon3(M%)+FNsyear(Y%)
 1400ENDCASE
 1410=FNd2(U%)+"/"+FNd2(M%)+"/"+FNd2(Y%)
 1420
 1430DEFFNnow:LOCALT%,D%,M%,Y%:T%=END+1:?T%=1:SYS 7,14,T%
 1440D%=VALSTR$~T%?2:M%=VALSTR$~T%?1:Y%=1900+VALSTR$~?T%:=FNdays(D%,M%,Y%)
 1450
 1460DEFFNreaddate(T$):LOCALD%,M%,Y%,T%,M$:T$=FNsu(T$)
 1470M$="MON.TUE.WED.THU.FRI.SAT.SUN."
 1480IFINSTR(M$,LEFT$(T$,3)+"."):REPEATT$=MID$(T$,2):UNTILASCT$<65ORASCT$>90
 1490WHILE(ASCT$>-1ANDASCT$<48)OR(ASCT$>57ANDASCT$<65)ORASCT$>90
 1500T$=MID$(T$,2):ENDWHILE
 1510M$="JAN.FEB.MAR.APR.MAY.JUN.JUL.AUG.SEP.OCT.NOV.DEC."
 1520IFVALT$>=10100:IFSTR$VALT$=RIGHT$(T$,LENSTR$VALT$):=FNdays(VALLEFT$(T$,LENT$-4),VALMID$(T$,LENT$-3,2),1900+VALRIGHT$(T$,2))
 1530IFVALT$=0THEN
 1540M%=INSTR(M$,LEFT$(T$,3)+"."):IFM%=0:=0
 1550T$=MID$(T$,4):M%=(M%-1)DIV4+1
 1560WHILE(ASCT$<48ORASCT$>57)ANDASCT$<>43ANDT$<>"":T$=MID$(T$,2):ENDWHILE
 1570D%=FNinpnum(T$):IFD%<1ORD%>31:=0
 1580ELSE
 1590D%=FNinpnum(T$):IFD%<1ORD%>31:=0
 1600M%=0:WHILEM%=0
 1610IFT$=""OR(ASCT$>=48ANDASCT$<=57)THEN
 1620M%=FNinpnum(T$):IFM%<1ORM%>12:M%=FNnmon(FNnow)
 1630ELSE
 1640M%=INSTR(M$,LEFT$(T$,3)+"."):IFM%>0T$=MID$(T$,4):M%=(M%-1)DIV4+1
 1650ENDIF:IFM%=0:T$=MID$(T$,2)
 1660ENDWHILE
 1670ENDIF
 1680WHILE(ASCT$<48ORASCT$>57)ANDASCT$<>43ANDT$<>"":T$=MID$(T$,2):ENDWHILE
 1690T%=ASCT$:Y%=FNinpnum(T$):IFY%<100ANDY%>0ANDT%<>43Y%+=1900
 1700IFY%=0ANDT%<>43Y%=FNnyear(FNnow)
 1710=FNdays(D%,M%,Y%)
 1720
 1730DEFFNinpnum(RETURN T$):LOCALT%:T%=VALT$
 1740WHILEASCT$=43OR(ASCT$>=48ANDASCT$<=57):T$=MID$(T$,2):ENDWHILE:=T%
 1750
 1760DEFFNp(T$):LOCALI%:I%=INSTR(T$,"."):IFI%=0:I%=LENT$+1
 1770=VAL(LEFT$(T$,I%-1)+MID$(T$+"00",I%+1,2))
 1780
 1790DEFFN`(T%):LOCALT$:T$=STR$T%:IFASCT$<>ASC"-":T$=" "+T$
 1800WHILELENT$<3:T$=LEFT$(T$)+"0"+MID$(T$,2):ENDWHILE:IFASCT$=32:T$=MID$(T$,2)
 1810=LEFT$(T$,LENT$-2)+"."+RIGHT$(T$,2)
 1820
 1830DEFFNnum(a)
 1840LOCAL@%:@%=&102020C
 1850=RIGHT$("          "+STR$a,12)
 1860
 1870DEFFNfilevar(T$):SYSswi%,sd57_%,T$TOG%
 1880=G%
 1890
 1900DEFFNcasetrim(T$):IFT$="":=""
 1910LOCALF%,I%,C%:F%=TRUE:FORI%=1TOLENT$
 1920C%=ASCMID$(T$,I%):IFF%THEN
 1930IFC%>96ANDC%<123MID$(T$,I%,1)=CHR$(C%-32)
 1940ELSE
 1950IFC%>64ANDC%<91MID$(T$,I%,1)=CHR$(C%+32)
 1960ENDIF
 1970F%=C%=32:NEXT:=T$
 1980
 1990DEFPROCld_init:ld_maxlen%=25:ld_add%=1:ld_chg%=2:ld_del%=2:DIM ld%(ld_maxlen%,ld_maxlen%):ENDPROC
 2000
 2010DEFFNdifference(R$,F$):LOCALI%,J%,R%,F%
 2020ld_maxlen%=ld_maxlen%:IFld_maxlen%=0PROCld_init
 2030R%=LENR$:IFR%>ld_maxlen%R%=ld_maxlen%
 2040F%=LENF$:IFF%>ld_maxlen%F%=ld_maxlen%
 2050ld%(0,0)=0
 2060FORJ%=1TOld_maxlen%:ld%(0,J%)=ld%(0,J%-1)+ld_add%:NEXT
 2070FORJ%=1TOld_maxlen%:ld%(J%,0)=ld%(J%-1,0)+ld_del%:NEXT
 2080FORI%=1TOR%:FORJ%=1TOF%
 2090ld%(I%,J%)=FNld_small(ld%(I%-1,J%-1)+FNld_zeq(I%,J%),ld%(I%,J%-1)+ld_add%,ld%(I%-1,J%)+ld_del%)
 2100NEXT:NEXT
 2110=ld%(R%,F%)
 2120
 2130DEFFNld_small(X%,Y%,Z%)
 2140IFX%<Y%THEN
 2150IFX%<Z%:=X%
 2160ELSE
 2170IFY%<Z%:=Y%
 2180ENDIF
 2190=Z%
 2200
 2210DEFFNld_zeq(X%,Y%):IFMID$(R$,X%,1)=MID$(F$,Y%,1):=0:ELSE=ld_chg%
 2220
 2230DEFFNsimilar(R$,F$):LOCALT%
 2240ld_maxlen%=ld_maxlen%:IFld_maxlen%=0PROCld_init
 2250T%=(LENR$+2)/4+1:IFABS(LENR$-LENF$)>T%:=FALSE
 2260T%=LENR$:IFT%>ld_maxlen%T%=ld_maxlen%
 2270T%=(LENR$+2)/4+1:=FNdifference(R$,F$)<=T%
 2280
 2290-BASE FUNCTIONS END---------------------------------------------------

 � > <MultiStore$Dir>.BaseLib
?�   By Merlyn Kline for Copyright (c) 1989 Minerva Software

(1�   BASE functions as described in the manual
2
<
FJ-BASE FUNCTIONS-------------------------------------------------------
P
Z%ݤc="C"+�"000000000"+äv_(15),10)
d
nݤsurn(A$):�I%,C%
x-ȕ�A$,1)=" ":A$=�A$):�:I%=�A$:C%=��A$,I%)
�5ȕI%>0�((C%>64�C%<91)�(C%>96�C%<123)�C%=45):I%-=1
�C%=��A$,I%):�
�=�A$,I%+1)
�
�"ݤs(T$):$sd%=T$:șswi%,strip_%
�#ݤup(T$):$sd%=T$:șswi%,upper_%
�"ݤu(T$):$sd%=T$:șswi%,upper_%
�2ݤsu(T$):$sd%=T$:șswi%,strip_%:șswi%,upper_%
�	=$sd%
�
�ݤlink(a$,f$,T$)
�
�T%,I%,n%
�șswi%,sd13_%,f$:n%=�v_(15)
șswi%,sd45_%,"N",f$
șswi%,find_%,T$,f$�G%
T%=G%:șswi%,sd45_%,"E",f$
"*�T%>0:șswi%,sd13_%:="** No Record **"
,șswi%,gfield_%,a$,f$
6'�n%<=�v_(17):șswi%,grec_%,n%,f$�N%
@șswi%,sd13_%:=$sd%
J 
T)ݤsearchall(A$):�I%,J%:I%=1:J%=�v_(7)
^ݤsearch(A$,I%,J%)
hA$=�up(A$):ȕI%<=J%
rșswi%,gfield_%,I%
|șswi%,upper_%
��$sd%,A$):=�
�I%+=1:�
�=�
�
�ݤpad(T$,T%)
�$T$=��ss(T$),T%):T$+=�T%-�T$," ")
�=T$
�
�'ݤi(A$,B$):�B$>�A$:=0:�=�A$,B$)<>0
�
�$ݤnumberth(N):�A$,B$,T$,T%,I%:��
�T$=�number(N):�+12
�+T%=0:�:�A$,A$:T%=T%+1:�A$=�T$,�A$):�+13
�I%=1�T%:�B$:�
0�B$="*":=T$+"th":��B$="+":=�T$,�T$-1)+"ieth"
=�T$,�T$-�A$)+B$
&
0ݤnumber(N):�N$,U$,U%,M%:��
:N$="":�N<0 N$="minus ":N=�N
D��N<21 =N$+�ln(N):��+4:�:�U%,U$:�U%<=N:M%=N/U%:N=N-M%*U%:�U%<100�N=0 =N$+U$:��U%<100 =N$+U$+" "+�number(N):��N=0 =N$+�number(M%)+" "+U$:��N<1 =N$+�number(M%)+" "+U$+" "+�number(N)
N[�N<100 =N$+�number(M%)+" "+U$+" and "+�number(N):�=N$+�number(M%)+" "+U$+" "+�number(N)
X�ݤln(N):�U%,U$,N$,F$,I%,@%:�+3:�:�U%,U$:�U%<=N:�N-�(N)<.00001�=U$:�N$=�U$+" ",U%*5)+"point":@%=&1020518:F$=��(N),5)+"0":�F$=�F$,�F$-1):��F$,1)<>"0"
b-�I%=1��F$:N$=N$+" "+�ln(��F$,I%,1)):�:=N$
ly�1E9,billion,1E6,million,1E3,thousand,100,hundred,90,ninety,80,eighty,70,seventy,60,sixty,50,fifty,40,forty,30,thirty
v��20,twenty,19,nineteen,18,eighteen,17,seventeen,16,sixteen,15,fifteen,14,fourteen,13,thirteen,12,twelve,11,eleven,10,ten,9,nine,8,eight,7,seven,6,six,5,five,4,four,3,three,2,two,1,one,0,zero
�d�*,*,*,*,+,+,+,+,+,+,+,+,*,*,*,*,*,*,*,twelfth,*,*,ninth,eighth,*,*,fifth,*,third,second,first,*
�
�$ݤcardinal(T%):�T%>3�T%<20:="th"
�/T%=T%�10:=�"thstndrdthththththth",T%*2+1,2)
�
�!ݤlower(T$):�I%,C%:�T$="":=""
��I%=1��T$:C%=��T$,I%)
�#�C%>64�C%<91:�T$,I%,1)=�(C%+32)
�	�:=T$
�
�ݤss(T$):�T%:�T%=�T$,"  ")
��T%>0T$=�T$,T%-1)+�T$,T%+1)
��T%=0:=�s(T$)

ݤtidy(T$):=�casetrim(T$)

 (ݤdays(D%,M%,Y%):�Y%<0�M%<1�M%>12:=0
*�Y%<100Y%+=1900
4�L%:L%=�leap(Y%)
>@�D%<1�D%>��"312831303130313130313031",M%*2-1,2)-(L%�M%=2):=0
Hr=1284095+D%+��"000031059090120151181212243273304334",M%*3-2,3)+Y%*365+(Y%-1)�4-(Y%-1)�100+(Y%-1)�400-(L%�M%>2)
R
\ݤmon(M%):�T$:��
f�M%<1�M%>12:="Bad Month"
p�+1:�:�T$:M%-=1:�M%=0:=T$
z@�January,February,March,April,May,June,July,August,September
��October,November,December
�
�ݤmon3(M%)=��mon(M%),3)
�ݤmon4(M%)=��mon(M%),4)
�ݤmon9(M%)=�pad(�mon(M%),9)
�
�ݤwday(D%):�T$:D%=D%�7
��+1:�:�T$:D%-=1:�D%<0:=T$
�=�Friday,Saturday,Sunday,Monday,Tuesday,Wednesday,Thursday
�
�ݤwday3(D%)=��wday(D%),3)
�
�Qݤnyear(D%):D%-=1284095:=(D%-(D%-29)�1461+(D%-29)�36524-(D%-29)�146097-1)�365
 
ݤnmon(D%):�L%,M%
2L%=�nyear(D%):D%=D%-�days(1,1,L%):L%=�leap(L%)
$M%=-2:�:M%+=3
.@�D%<��"031059090120151181212243273304334367",M%,3)-(L%�M%>3)
8=M%�3+1
B 
L1ݤnday(D%)=D%+1-�days(1,�nmon(D%),�nyear(D%))
V
`'��expdate(T%,� D%,� M%,� Y%):�L%,U%
j@Y%=�nyear(T%):U%=T%-�days(1,1,Y%):L%=�leap(Y%):M%=-2:�:M%+=3
t@�U%<��"031059090120151181212243273304334367",M%,3)-(L%�M%>3)
~&M%=M%�3+1:D%=T%+1-�days(1,M%,Y%):�
�
�!ݤsyear(Y%)=" "+�"000"+�Y%,4)
�
�ݤsmon(M%)=�mon(M%)
�
�ݤd2(T%)=�"0"+�T%,2)
�
�(ݤleap(Y%)=Y%�4=0�Y%�100<>0�Y%�400=0
�
�1ݤstrdate(U%,M%,Y%,T%):�D%:D%=�days(U%,M%,Y%)
�5ݤstrdate1(D%,T%):�U%,M%,Y%:�expdate(D%,U%,M%,Y%)
��D%<1:="Error!"
	ȎT%�

@�1:=�wday(D%)+" "+�U%+�cardinal(U%)+" "+�smon(M%)+�syear(Y%)
,�2:=�mon3(M%)+" "+�"0"+�U%,2)+�syear(Y%)
2�3:=�U%+�cardinal(U%)+" "+�mon3(M%)+�syear(Y%)
(A�4:=�wday3(D%)+" "+�U%+�cardinal(U%)+" "+�mon3(M%)+�syear(Y%)
2'�5:=�d2(M%)+"/"+�d2(U%)+"/"+�d2(Y%)
<Y�6:="The "+�numberth(U%)+" day of "+�smon(M%)+" in the year of our Lord "+�number(Y%)
F2�7:=�U%+�cardinal(U%)+" "+�smon(M%)+�syear(Y%)
Po�8:="The "+�casetrim(�numberth(U%))+" day of "+�smon(M%)+" in the year of our Lord "+�casetrim(�number(Y%))
Z"�10:=�d2(U%)+�mon3(M%)+�d2(Y%)
d �11:=�d2(U%)+�d2(M%)+�d2(Y%)
n%�12:=�U%+" "+�mon3(M%)+�syear(Y%)
x�
�$=�d2(U%)+"/"+�d2(M%)+"/"+�d2(Y%)
�
�.ݤnow:�T%,D%,M%,Y%:T%=�+1:?T%=1:ș 7,14,T%
�9D%=��~T%?2:M%=��~T%?1:Y%=1900+��~?T%:=�days(D%,M%,Y%)
�
�-ݤreaddate(T$):�D%,M%,Y%,T%,M$:T$=�su(T$)
�%M$="MON.TUE.WED.THU.FRI.SAT.SUN."
�.�M$,�T$,3)+"."):�T$=�T$,2):��T$<65��T$>90
�,ȕ(�T$>-1��T$<48)�(�T$>57��T$<65)��T$>90
�T$=�T$,2):�
�9M$="JAN.FEB.MAR.APR.MAY.JUN.JUL.AUG.SEP.OCT.NOV.DEC."
�O�T$>=10100:�ûT$=�T$,�ûT$):=�days(��T$,�T$-4),��T$,�T$-3,2),1900+��T$,2))
��T$=0�
M%=�M$,�T$,3)+"."):�M%=0:=0
T$=�T$,4):M%=(M%-1)�4+1
0ȕ(�T$<48��T$>57)��T$<>43�T$<>"":T$=�T$,2):�
"!D%=�inpnum(T$):�D%<1�D%>31:=0
,�
6!D%=�inpnum(T$):�D%<1�D%>31:=0
@M%=0:ȕM%=0
J�T$=""�(�T$>=48��T$<=57)�
T-M%=�inpnum(T$):�M%<1�M%>12:M%=�nmon(�now)
^�
h3M%=�M$,�T$,3)+"."):�M%>0T$=�T$,4):M%=(M%-1)�4+1
r�:�M%=0:T$=�T$,2)
|�
��
�0ȕ(�T$<48��T$>57)��T$<>43�T$<>"":T$=�T$,2):�
�5T%=�T$:Y%=�inpnum(T$):�Y%<100�Y%>0�T%<>43Y%+=1900
��Y%=0�T%<>43Y%=�nyear(�now)
�=�days(D%,M%,Y%)
�
�ݤinpnum(� T$):�T%:T%=�T$
�.ȕ�T$=43�(�T$>=48��T$<=57):T$=�T$,2):�:=T%
�
�*ݤp(T$):�I%:I%=�T$,"."):�I%=0:I%=�T$+1
�"=�(�T$,I%-1)+�T$+"00",I%+1,2))
�
�+ݤ`(T%):�T$:T$=�T%:�T$<>�"-":T$=" "+T$
2ȕ�T$<3:T$=�T$)+"0"+�T$,2):�:�T$=32:T$=�T$,2)
=�T$,�T$-2)+"."+�T$,2)

&ݤnum(a)
0�@%:@%=&102020C
:=�"          "+�a,12)
D
N%ݤfilevar(T$):șswi%,sd57_%,T$�G%
X=G%
b
lݤcasetrim(T$):�T$="":=""
v�F%,I%,C%:F%=�:�I%=1��T$
�C%=��T$,I%):�F%�
�#�C%>96�C%<123�T$,I%,1)=�(C%-32)
��
�"�C%>64�C%<91�T$,I%,1)=�(C%+32)
��
�F%=C%=32:�:=T$
�
�X��ld_init:ld_maxlen%=25:ld_add%=1:ld_chg%=2:ld_del%=2:� ld%(ld_maxlen%,ld_maxlen%):�
�
�$ݤdifference(R$,F$):�I%,J%,R%,F%
�/ld_maxlen%=ld_maxlen%:�ld_maxlen%=0�ld_init
�&R%=�R$:�R%>ld_maxlen%R%=ld_maxlen%
�&F%=�F$:�F%>ld_maxlen%F%=ld_maxlen%
ld%(0,0)=0
4�J%=1�ld_maxlen%:ld%(0,J%)=ld%(0,J%-1)+ld_add%:�
4�J%=1�ld_maxlen%:ld%(J%,0)=ld%(J%-1,0)+ld_del%:�
 �I%=1�R%:�J%=1�F%
*ald%(I%,J%)=�ld_small(ld%(I%-1,J%-1)+�ld_zeq(I%,J%),ld%(I%,J%-1)+ld_add%,ld%(I%-1,J%)+ld_del%)
4�:�
>=ld%(R%,F%)
H
Rݤld_small(X%,Y%,Z%)
\�X%<Y%�
f�X%<Z%:=X%
p�
z�Y%<Z%:=Y%
��
�=Z%
�
�5ݤld_zeq(X%,Y%):�R$,X%,1)=�F$,Y%,1):=0:�=ld_chg%
�
�ݤsimilar(R$,F$):�T%
�/ld_maxlen%=ld_maxlen%:�ld_maxlen%=0�ld_init
�$T%=(�R$+2)/4+1:�(�R$-�F$)>T%:=�
�&T%=�R$:�T%>ld_maxlen%T%=ld_maxlen%
�*T%=(�R$+2)/4+1:=�difference(R$,F$)<=T%
�
�H-BASE FUNCTIONS �---------------------------------------------------
�
00000000  0d 00 0a 20 f4 20 3e 20  3c 4d 75 6c 74 69 53 74  |... . > <MultiSt|
00000010  6f 72 65 24 44 69 72 3e  2e 42 61 73 65 4c 69 62  |ore$Dir>.BaseLib|
00000020  0d 00 14 3f f4 20 20 20  42 79 20 4d 65 72 6c 79  |...?.   By Merly|
00000030  6e 20 4b 6c 69 6e 65 20  66 6f 72 20 43 6f 70 79  |n Kline for Copy|
00000040  72 69 67 68 74 20 28 63  29 20 31 39 38 39 20 4d  |right (c) 1989 M|
00000050  69 6e 65 72 76 61 20 53  6f 66 74 77 61 72 65 0d  |inerva Software.|
00000060  00 1e 04 0d 00 28 31 f4  20 20 20 42 41 53 45 20  |.....(1.   BASE |
00000070  66 75 6e 63 74 69 6f 6e  73 20 61 73 20 64 65 73  |functions as des|
00000080  63 72 69 62 65 64 20 69  6e 20 74 68 65 20 6d 61  |cribed in the ma|
00000090  6e 75 61 6c 0d 00 32 04  0d 00 3c 04 0d 00 46 4a  |nual..2...<...FJ|
000000a0  2d 42 41 53 45 20 46 55  4e 43 54 49 4f 4e 53 2d  |-BASE FUNCTIONS-|
000000b0  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |----------------|
*
000000e0  2d 2d 2d 2d 2d 2d 0d 00  50 04 0d 00 5a 25 dd a4  |------..P...Z%..|
000000f0  63 3d 22 43 22 2b c2 22  30 30 30 30 30 30 30 30  |c="C"+."00000000|
00000100  30 22 2b c3 a4 76 5f 28  31 35 29 2c 31 30 29 0d  |0"+..v_(15),10).|
00000110  00 64 04 0d 00 6e 15 dd  a4 73 75 72 6e 28 41 24  |.d...n...surn(A$|
00000120  29 3a ea 49 25 2c 43 25  0d 00 78 2d c8 95 c2 41  |):.I%,C%..x-...A|
00000130  24 2c 31 29 3d 22 20 22  3a 41 24 3d c0 41 24 29  |$,1)=" ":A$=.A$)|
00000140  3a ce 3a 49 25 3d a9 41  24 3a 43 25 3d 97 c1 41  |:.:I%=.A$:C%=..A|
00000150  24 2c 49 25 29 0d 00 82  35 c8 95 49 25 3e 30 80  |$,I%)...5..I%>0.|
00000160  28 28 43 25 3e 36 34 80  43 25 3c 39 31 29 84 28  |((C%>64.C%<91).(|
00000170  43 25 3e 39 36 80 43 25  3c 31 32 33 29 84 43 25  |C%>96.C%<123).C%|
00000180  3d 34 35 29 3a 49 25 2d  3d 31 0d 00 8c 11 43 25  |=45):I%-=1....C%|
00000190  3d 97 c1 41 24 2c 49 25  29 3a ce 0d 00 96 0e 3d  |=..A$,I%):.....=|
000001a0  c1 41 24 2c 49 25 2b 31  29 0d 00 a0 04 0d 00 aa  |.A$,I%+1).......|
000001b0  22 dd a4 73 28 54 24 29  3a 24 73 64 25 3d 54 24  |"..s(T$):$sd%=T$|
000001c0  3a c8 99 73 77 69 25 2c  73 74 72 69 70 5f 25 0d  |:..swi%,strip_%.|
000001d0  00 b4 23 dd a4 75 70 28  54 24 29 3a 24 73 64 25  |..#..up(T$):$sd%|
000001e0  3d 54 24 3a c8 99 73 77  69 25 2c 75 70 70 65 72  |=T$:..swi%,upper|
000001f0  5f 25 0d 00 be 22 dd a4  75 28 54 24 29 3a 24 73  |_%..."..u(T$):$s|
00000200  64 25 3d 54 24 3a c8 99  73 77 69 25 2c 75 70 70  |d%=T$:..swi%,upp|
00000210  65 72 5f 25 0d 00 c8 32  dd a4 73 75 28 54 24 29  |er_%...2..su(T$)|
00000220  3a 24 73 64 25 3d 54 24  3a c8 99 73 77 69 25 2c  |:$sd%=T$:..swi%,|
00000230  73 74 72 69 70 5f 25 3a  c8 99 73 77 69 25 2c 75  |strip_%:..swi%,u|
00000240  70 70 65 72 5f 25 0d 00  d2 09 3d 24 73 64 25 0d  |pper_%....=$sd%.|
00000250  00 dc 04 0d 00 e6 14 dd  a4 6c 69 6e 6b 28 61 24  |.........link(a$|
00000260  2c 66 24 2c 54 24 29 0d  00 f0 0d ea 54 25 2c 49  |,f$,T$).....T%,I|
00000270  25 2c 6e 25 0d 00 fa 1f  c8 99 73 77 69 25 2c 73  |%,n%......swi%,s|
00000280  64 31 33 5f 25 2c 66 24  3a 6e 25 3d a4 76 5f 28  |d13_%,f$:n%=.v_(|
00000290  31 35 29 0d 01 04 18 c8  99 73 77 69 25 2c 73 64  |15)......swi%,sd|
000002a0  34 35 5f 25 2c 22 4e 22  2c 66 24 0d 01 0e 1a c8  |45_%,"N",f$.....|
000002b0  99 73 77 69 25 2c 66 69  6e 64 5f 25 2c 54 24 2c  |.swi%,find_%,T$,|
000002c0  66 24 b8 47 25 0d 01 18  1e 54 25 3d 47 25 3a c8  |f$.G%....T%=G%:.|
000002d0  99 73 77 69 25 2c 73 64  34 35 5f 25 2c 22 45 22  |.swi%,sd45_%,"E"|
000002e0  2c 66 24 0d 01 22 2a e7  54 25 3e 30 3a c8 99 73  |,f$.."*.T%>0:..s|
000002f0  77 69 25 2c 73 64 31 33  5f 25 3a 3d 22 2a 2a 20  |wi%,sd13_%:="** |
00000300  4e 6f 20 52 65 63 6f 72  64 20 2a 2a 22 0d 01 2c  |No Record **"..,|
00000310  19 c8 99 73 77 69 25 2c  67 66 69 65 6c 64 5f 25  |...swi%,gfield_%|
00000320  2c 61 24 2c 66 24 0d 01  36 27 e7 6e 25 3c 3d a4  |,a$,f$..6'.n%<=.|
00000330  76 5f 28 31 37 29 3a c8  99 73 77 69 25 2c 67 72  |v_(17):..swi%,gr|
00000340  65 63 5f 25 2c 6e 25 2c  66 24 b8 4e 25 0d 01 40  |ec_%,n%,f$.N%..@|
00000350  17 c8 99 73 77 69 25 2c  73 64 31 33 5f 25 3a 3d  |...swi%,sd13_%:=|
00000360  24 73 64 25 0d 01 4a 05  20 0d 01 54 29 dd a4 73  |$sd%..J. ..T)..s|
00000370  65 61 72 63 68 61 6c 6c  28 41 24 29 3a ea 49 25  |earchall(A$):.I%|
00000380  2c 4a 25 3a 49 25 3d 31  3a 4a 25 3d a4 76 5f 28  |,J%:I%=1:J%=.v_(|
00000390  37 29 0d 01 5e 16 dd a4  73 65 61 72 63 68 28 41  |7)..^...search(A|
000003a0  24 2c 49 25 2c 4a 25 29  0d 01 68 17 41 24 3d a4  |$,I%,J%)..h.A$=.|
000003b0  75 70 28 41 24 29 3a c8  95 49 25 3c 3d 4a 25 0d  |up(A$):..I%<=J%.|
000003c0  01 72 16 c8 99 73 77 69  25 2c 67 66 69 65 6c 64  |.r...swi%,gfield|
000003d0  5f 25 2c 49 25 0d 01 7c  12 c8 99 73 77 69 25 2c  |_%,I%..|...swi%,|
000003e0  75 70 70 65 72 5f 25 0d  01 86 11 e7 a7 24 73 64  |upper_%......$sd|
000003f0  25 2c 41 24 29 3a 3d b9  0d 01 90 0b 49 25 2b 3d  |%,A$):=.....I%+=|
00000400  31 3a ce 0d 01 9a 06 3d  a3 0d 01 a4 04 0d 01 ae  |1:.....=........|
00000410  10 dd a4 70 61 64 28 54  24 2c 54 25 29 0d 01 b8  |...pad(T$,T%)...|
00000420  24 54 24 3d c0 a4 73 73  28 54 24 29 2c 54 25 29  |$T$=..ss(T$),T%)|
00000430  3a 54 24 2b 3d c4 54 25  2d a9 54 24 2c 22 20 22  |:T$+=.T%-.T$," "|
00000440  29 0d 01 c2 07 3d 54 24  0d 01 cc 04 0d 01 d6 27  |)....=T$.......'|
00000450  dd a4 69 28 41 24 2c 42  24 29 3a e7 a9 42 24 3e  |..i(A$,B$):..B$>|
00000460  a9 41 24 3a 3d 30 3a 8b  3d a7 41 24 2c 42 24 29  |.A$:=0:.=.A$,B$)|
00000470  3c 3e 30 0d 01 e0 04 0d  01 ea 24 dd a4 6e 75 6d  |<>0.......$..num|
00000480  62 65 72 74 68 28 4e 29  3a ea 41 24 2c 42 24 2c  |berth(N):.A$,B$,|
00000490  54 24 2c 54 25 2c 49 25  3a ea dc 0d 01 f4 16 54  |T$,T%,I%:......T|
000004a0  24 3d a4 6e 75 6d 62 65  72 28 4e 29 3a f7 2b 31  |$=.number(N):.+1|
000004b0  32 0d 01 fe 2b 54 25 3d  30 3a f5 3a f3 41 24 2c  |2...+T%=0:.:.A$,|
000004c0  41 24 3a 54 25 3d 54 25  2b 31 3a fd 41 24 3d c2  |A$:T%=T%+1:.A$=.|
000004d0  54 24 2c a9 41 24 29 3a  f7 2b 31 33 0d 02 08 12  |T$,.A$):.+13....|
000004e0  e3 49 25 3d 31 b8 54 25  3a f3 42 24 3a ed 0d 02  |.I%=1.T%:.B$:...|
000004f0  12 30 e7 42 24 3d 22 2a  22 3a 3d 54 24 2b 22 74  |.0.B$="*":=T$+"t|
00000500  68 22 3a 8b e7 42 24 3d  22 2b 22 3a 3d c0 54 24  |h":..B$="+":=.T$|
00000510  2c a9 54 24 2d 31 29 2b  22 69 65 74 68 22 0d 02  |,.T$-1)+"ieth"..|
00000520  1c 14 3d c0 54 24 2c a9  54 24 2d a9 41 24 29 2b  |..=.T$,.T$-.A$)+|
00000530  42 24 0d 02 26 04 0d 02  30 1f dd a4 6e 75 6d 62  |B$..&...0...numb|
00000540  65 72 28 4e 29 3a ea 4e  24 2c 55 24 2c 55 25 2c  |er(N):.N$,U$,U%,|
00000550  4d 25 3a ea dc 0d 02 3a  1f 4e 24 3d 22 22 3a e7  |M%:....:.N$="":.|
00000560  4e 3c 30 20 4e 24 3d 22  6d 69 6e 75 73 20 22 3a  |N<0 N$="minus ":|
00000570  4e 3d 94 4e 0d 02 44 b6  e7 4e 3c 32 31 20 3d 4e  |N=.N..D..N<21 =N|
00000580  24 2b a4 6c 6e 28 4e 29  3a 8b f7 2b 34 3a f5 3a  |$+.ln(N):..+4:.:|
00000590  f3 55 25 2c 55 24 3a fd  55 25 3c 3d 4e 3a 4d 25  |.U%,U$:.U%<=N:M%|
000005a0  3d 4e 2f 55 25 3a 4e 3d  4e 2d 4d 25 2a 55 25 3a  |=N/U%:N=N-M%*U%:|
000005b0  e7 55 25 3c 31 30 30 80  4e 3d 30 20 3d 4e 24 2b  |.U%<100.N=0 =N$+|
000005c0  55 24 3a 8b e7 55 25 3c  31 30 30 20 3d 4e 24 2b  |U$:..U%<100 =N$+|
000005d0  55 24 2b 22 20 22 2b a4  6e 75 6d 62 65 72 28 4e  |U$+" "+.number(N|
000005e0  29 3a 8b e7 4e 3d 30 20  3d 4e 24 2b a4 6e 75 6d  |):..N=0 =N$+.num|
000005f0  62 65 72 28 4d 25 29 2b  22 20 22 2b 55 24 3a 8b  |ber(M%)+" "+U$:.|
00000600  e7 4e 3c 31 20 3d 4e 24  2b a4 6e 75 6d 62 65 72  |.N<1 =N$+.number|
00000610  28 4d 25 29 2b 22 20 22  2b 55 24 2b 22 20 22 2b  |(M%)+" "+U$+" "+|
00000620  a4 6e 75 6d 62 65 72 28  4e 29 0d 02 4e 5b e7 4e  |.number(N)..N[.N|
00000630  3c 31 30 30 20 3d 4e 24  2b a4 6e 75 6d 62 65 72  |<100 =N$+.number|
00000640  28 4d 25 29 2b 22 20 22  2b 55 24 2b 22 20 61 6e  |(M%)+" "+U$+" an|
00000650  64 20 22 2b a4 6e 75 6d  62 65 72 28 4e 29 3a 8b  |d "+.number(N):.|
00000660  3d 4e 24 2b a4 6e 75 6d  62 65 72 28 4d 25 29 2b  |=N$+.number(M%)+|
00000670  22 20 22 2b 55 24 2b 22  20 22 2b a4 6e 75 6d 62  |" "+U$+" "+.numb|
00000680  65 72 28 4e 29 0d 02 58  97 dd a4 6c 6e 28 4e 29  |er(N)..X...ln(N)|
00000690  3a ea 55 25 2c 55 24 2c  4e 24 2c 46 24 2c 49 25  |:.U%,U$,N$,F$,I%|
000006a0  2c 40 25 3a f7 2b 33 3a  f5 3a f3 55 25 2c 55 24  |,@%:.+3:.:.U%,U$|
000006b0  3a fd 55 25 3c 3d 4e 3a  e7 4e 2d a8 28 4e 29 3c  |:.U%<=N:.N-.(N)<|
000006c0  2e 30 30 30 30 31 8c 3d  55 24 3a 8b 4e 24 3d c0  |.00001.=U$:.N$=.|
000006d0  55 24 2b 22 20 22 2c 55  25 2a 35 29 2b 22 70 6f  |U$+" ",U%*5)+"po|
000006e0  69 6e 74 22 3a 40 25 3d  26 31 30 32 30 35 31 38  |int":@%=&1020518|
000006f0  3a 46 24 3d c2 c3 28 4e  29 2c 35 29 2b 22 30 22  |:F$=..(N),5)+"0"|
00000700  3a f5 46 24 3d c0 46 24  2c a9 46 24 2d 31 29 3a  |:.F$=.F$,.F$-1):|
00000710  fd c2 46 24 2c 31 29 3c  3e 22 30 22 0d 02 62 2d  |..F$,1)<>"0"..b-|
00000720  e3 49 25 3d 31 b8 a9 46  24 3a 4e 24 3d 4e 24 2b  |.I%=1..F$:N$=N$+|
00000730  22 20 22 2b a4 6c 6e 28  bb c1 46 24 2c 49 25 2c  |" "+.ln(..F$,I%,|
00000740  31 29 29 3a ed 3a 3d 4e  24 0d 02 6c 79 dc 31 45  |1)):.:=N$..ly.1E|
00000750  39 2c 62 69 6c 6c 69 6f  6e 2c 31 45 36 2c 6d 69  |9,billion,1E6,mi|
00000760  6c 6c 69 6f 6e 2c 31 45  33 2c 74 68 6f 75 73 61  |llion,1E3,thousa|
00000770  6e 64 2c 31 30 30 2c 68  75 6e 64 72 65 64 2c 39  |nd,100,hundred,9|
00000780  30 2c 6e 69 6e 65 74 79  2c 38 30 2c 65 69 67 68  |0,ninety,80,eigh|
00000790  74 79 2c 37 30 2c 73 65  76 65 6e 74 79 2c 36 30  |ty,70,seventy,60|
000007a0  2c 73 69 78 74 79 2c 35  30 2c 66 69 66 74 79 2c  |,sixty,50,fifty,|
000007b0  34 30 2c 66 6f 72 74 79  2c 33 30 2c 74 68 69 72  |40,forty,30,thir|
000007c0  74 79 0d 02 76 c2 dc 32  30 2c 74 77 65 6e 74 79  |ty..v..20,twenty|
000007d0  2c 31 39 2c 6e 69 6e 65  74 65 65 6e 2c 31 38 2c  |,19,nineteen,18,|
000007e0  65 69 67 68 74 65 65 6e  2c 31 37 2c 73 65 76 65  |eighteen,17,seve|
000007f0  6e 74 65 65 6e 2c 31 36  2c 73 69 78 74 65 65 6e  |nteen,16,sixteen|
00000800  2c 31 35 2c 66 69 66 74  65 65 6e 2c 31 34 2c 66  |,15,fifteen,14,f|
00000810  6f 75 72 74 65 65 6e 2c  31 33 2c 74 68 69 72 74  |ourteen,13,thirt|
00000820  65 65 6e 2c 31 32 2c 74  77 65 6c 76 65 2c 31 31  |een,12,twelve,11|
00000830  2c 65 6c 65 76 65 6e 2c  31 30 2c 74 65 6e 2c 39  |,eleven,10,ten,9|
00000840  2c 6e 69 6e 65 2c 38 2c  65 69 67 68 74 2c 37 2c  |,nine,8,eight,7,|
00000850  73 65 76 65 6e 2c 36 2c  73 69 78 2c 35 2c 66 69  |seven,6,six,5,fi|
00000860  76 65 2c 34 2c 66 6f 75  72 2c 33 2c 74 68 72 65  |ve,4,four,3,thre|
00000870  65 2c 32 2c 74 77 6f 2c  31 2c 6f 6e 65 2c 30 2c  |e,2,two,1,one,0,|
00000880  7a 65 72 6f 0d 02 80 64  dc 2a 2c 2a 2c 2a 2c 2a  |zero...d.*,*,*,*|
00000890  2c 2b 2c 2b 2c 2b 2c 2b  2c 2b 2c 2b 2c 2b 2c 2b  |,+,+,+,+,+,+,+,+|
000008a0  2c 2a 2c 2a 2c 2a 2c 2a  2c 2a 2c 2a 2c 2a 2c 74  |,*,*,*,*,*,*,*,t|
000008b0  77 65 6c 66 74 68 2c 2a  2c 2a 2c 6e 69 6e 74 68  |welfth,*,*,ninth|
000008c0  2c 65 69 67 68 74 68 2c  2a 2c 2a 2c 66 69 66 74  |,eighth,*,*,fift|
000008d0  68 2c 2a 2c 74 68 69 72  64 2c 73 65 63 6f 6e 64  |h,*,third,second|
000008e0  2c 66 69 72 73 74 2c 2a  0d 02 8a 04 0d 02 94 24  |,first,*.......$|
000008f0  dd a4 63 61 72 64 69 6e  61 6c 28 54 25 29 3a e7  |..cardinal(T%):.|
00000900  54 25 3e 33 80 54 25 3c  32 30 3a 3d 22 74 68 22  |T%>3.T%<20:="th"|
00000910  0d 02 9e 2f 54 25 3d 54  25 83 31 30 3a 3d c1 22  |.../T%=T%.10:=."|
00000920  74 68 73 74 6e 64 72 64  74 68 74 68 74 68 74 68  |thstndrdthththth|
00000930  74 68 74 68 22 2c 54 25  2a 32 2b 31 2c 32 29 0d  |thth",T%*2+1,2).|
00000940  02 a8 04 0d 02 b2 21 dd  a4 6c 6f 77 65 72 28 54  |......!..lower(T|
00000950  24 29 3a ea 49 25 2c 43  25 3a e7 54 24 3d 22 22  |$):.I%,C%:.T$=""|
00000960  3a 3d 22 22 0d 02 bc 19  e3 49 25 3d 31 b8 a9 54  |:="".....I%=1..T|
00000970  24 3a 43 25 3d 97 c1 54  24 2c 49 25 29 0d 02 c6  |$:C%=..T$,I%)...|
00000980  23 e7 43 25 3e 36 34 80  43 25 3c 39 31 3a c1 54  |#.C%>64.C%<91:.T|
00000990  24 2c 49 25 2c 31 29 3d  bd 28 43 25 2b 33 32 29  |$,I%,1)=.(C%+32)|
000009a0  0d 02 d0 09 ed 3a 3d 54  24 0d 02 da 04 0d 02 e4  |.....:=T$.......|
000009b0  1e dd a4 73 73 28 54 24  29 3a ea 54 25 3a f5 54  |...ss(T$):.T%:.T|
000009c0  25 3d a7 54 24 2c 22 20  20 22 29 0d 02 ee 1f e7  |%=.T$,"  ").....|
000009d0  54 25 3e 30 54 24 3d c0  54 24 2c 54 25 2d 31 29  |T%>0T$=.T$,T%-1)|
000009e0  2b c1 54 24 2c 54 25 2b  31 29 0d 02 f8 11 fd 54  |+.T$,T%+1).....T|
000009f0  25 3d 30 3a 3d a4 73 28  54 24 29 0d 03 02 04 0d  |%=0:=.s(T$).....|
00000a00  03 0c 1d dd a4 74 69 64  79 28 54 24 29 3a 3d a4  |.....tidy(T$):=.|
00000a10  63 61 73 65 74 72 69 6d  28 54 24 29 0d 03 16 04  |casetrim(T$)....|
00000a20  0d 03 20 28 dd a4 64 61  79 73 28 44 25 2c 4d 25  |.. (..days(D%,M%|
00000a30  2c 59 25 29 3a e7 59 25  3c 30 84 4d 25 3c 31 84  |,Y%):.Y%<0.M%<1.|
00000a40  4d 25 3e 31 32 3a 3d 30  0d 03 2a 13 e7 59 25 3c  |M%>12:=0..*..Y%<|
00000a50  31 30 30 59 25 2b 3d 31  39 30 30 0d 03 34 14 ea  |100Y%+=1900..4..|
00000a60  4c 25 3a 4c 25 3d a4 6c  65 61 70 28 59 25 29 0d  |L%:L%=.leap(Y%).|
00000a70  03 3e 40 e7 44 25 3c 31  84 44 25 3e bb c1 22 33  |.>@.D%<1.D%>.."3|
00000a80  31 32 38 33 31 33 30 33  31 33 30 33 31 33 31 33  |1283130313031313|
00000a90  30 33 31 33 30 33 31 22  2c 4d 25 2a 32 2d 31 2c  |0313031",M%*2-1,|
00000aa0  32 29 2d 28 4c 25 80 4d  25 3d 32 29 3a 3d 30 0d  |2)-(L%.M%=2):=0.|
00000ab0  03 48 72 3d 31 32 38 34  30 39 35 2b 44 25 2b bb  |.Hr=1284095+D%+.|
00000ac0  c1 22 30 30 30 30 33 31  30 35 39 30 39 30 31 32  |."00003105909012|
00000ad0  30 31 35 31 31 38 31 32  31 32 32 34 33 32 37 33  |0151181212243273|
00000ae0  33 30 34 33 33 34 22 2c  4d 25 2a 33 2d 32 2c 33  |304334",M%*3-2,3|
00000af0  29 2b 59 25 2a 33 36 35  2b 28 59 25 2d 31 29 81  |)+Y%*365+(Y%-1).|
00000b00  34 2d 28 59 25 2d 31 29  81 31 30 30 2b 28 59 25  |4-(Y%-1).100+(Y%|
00000b10  2d 31 29 81 34 30 30 2d  28 4c 25 80 4d 25 3e 32  |-1).400-(L%.M%>2|
00000b20  29 0d 03 52 04 0d 03 5c  14 dd a4 6d 6f 6e 28 4d  |)..R...\...mon(M|
00000b30  25 29 3a ea 54 24 3a ea  dc 0d 03 66 1c e7 4d 25  |%):.T$:....f..M%|
00000b40  3c 31 84 4d 25 3e 31 32  3a 3d 22 42 61 64 20 4d  |<1.M%>12:="Bad M|
00000b50  6f 6e 74 68 22 0d 03 70  1d f7 2b 31 3a f5 3a f3  |onth"..p..+1:.:.|
00000b60  54 24 3a 4d 25 2d 3d 31  3a fd 4d 25 3d 30 3a 3d  |T$:M%-=1:.M%=0:=|
00000b70  54 24 0d 03 7a 40 dc 4a  61 6e 75 61 72 79 2c 46  |T$..z@.January,F|
00000b80  65 62 72 75 61 72 79 2c  4d 61 72 63 68 2c 41 70  |ebruary,March,Ap|
00000b90  72 69 6c 2c 4d 61 79 2c  4a 75 6e 65 2c 4a 75 6c  |ril,May,June,Jul|
00000ba0  79 2c 41 75 67 75 73 74  2c 53 65 70 74 65 6d 62  |y,August,Septemb|
00000bb0  65 72 0d 03 84 1e dc 4f  63 74 6f 62 65 72 2c 4e  |er.....October,N|
00000bc0  6f 76 65 6d 62 65 72 2c  44 65 63 65 6d 62 65 72  |ovember,December|
00000bd0  0d 03 8e 04 0d 03 98 1b  dd a4 6d 6f 6e 33 28 4d  |..........mon3(M|
00000be0  25 29 3d c0 a4 6d 6f 6e  28 4d 25 29 2c 33 29 0d  |%)=..mon(M%),3).|
00000bf0  03 a2 1b dd a4 6d 6f 6e  34 28 4d 25 29 3d c0 a4  |.....mon4(M%)=..|
00000c00  6d 6f 6e 28 4d 25 29 2c  34 29 0d 03 ac 1f dd a4  |mon(M%),4)......|
00000c10  6d 6f 6e 39 28 4d 25 29  3d a4 70 61 64 28 a4 6d  |mon9(M%)=.pad(.m|
00000c20  6f 6e 28 4d 25 29 2c 39  29 0d 03 b6 04 0d 03 c0  |on(M%),9).......|
00000c30  1a dd a4 77 64 61 79 28  44 25 29 3a ea 54 24 3a  |...wday(D%):.T$:|
00000c40  44 25 3d 44 25 83 37 0d  03 ca 1d f7 2b 31 3a f5  |D%=D%.7.....+1:.|
00000c50  3a f3 54 24 3a 44 25 2d  3d 31 3a fd 44 25 3c 30  |:.T$:D%-=1:.D%<0|
00000c60  3a 3d 54 24 0d 03 d4 3d  dc 46 72 69 64 61 79 2c  |:=T$...=.Friday,|
00000c70  53 61 74 75 72 64 61 79  2c 53 75 6e 64 61 79 2c  |Saturday,Sunday,|
00000c80  4d 6f 6e 64 61 79 2c 54  75 65 73 64 61 79 2c 57  |Monday,Tuesday,W|
00000c90  65 64 6e 65 73 64 61 79  2c 54 68 75 72 73 64 61  |ednesday,Thursda|
00000ca0  79 0d 03 de 04 0d 03 e8  1d dd a4 77 64 61 79 33  |y..........wday3|
00000cb0  28 44 25 29 3d c0 a4 77  64 61 79 28 44 25 29 2c  |(D%)=..wday(D%),|
00000cc0  33 29 0d 03 f2 04 0d 03  fc 51 dd a4 6e 79 65 61  |3).......Q..nyea|
00000cd0  72 28 44 25 29 3a 44 25  2d 3d 31 32 38 34 30 39  |r(D%):D%-=128409|
00000ce0  35 3a 3d 28 44 25 2d 28  44 25 2d 32 39 29 81 31  |5:=(D%-(D%-29).1|
00000cf0  34 36 31 2b 28 44 25 2d  32 39 29 81 33 36 35 32  |461+(D%-29).3652|
00000d00  34 2d 28 44 25 2d 32 39  29 81 31 34 36 30 39 37  |4-(D%-29).146097|
00000d10  2d 31 29 81 33 36 35 0d  04 06 05 20 0d 04 10 15  |-1).365.... ....|
00000d20  dd a4 6e 6d 6f 6e 28 44  25 29 3a ea 4c 25 2c 4d  |..nmon(D%):.L%,M|
00000d30  25 0d 04 1a 32 4c 25 3d  a4 6e 79 65 61 72 28 44  |%...2L%=.nyear(D|
00000d40  25 29 3a 44 25 3d 44 25  2d a4 64 61 79 73 28 31  |%):D%=D%-.days(1|
00000d50  2c 31 2c 4c 25 29 3a 4c  25 3d a4 6c 65 61 70 28  |,1,L%):L%=.leap(|
00000d60  4c 25 29 0d 04 24 11 4d  25 3d 2d 32 3a f5 3a 4d  |L%)..$.M%=-2:.:M|
00000d70  25 2b 3d 33 0d 04 2e 40  fd 44 25 3c bb c1 22 30  |%+=3...@.D%<.."0|
00000d80  33 31 30 35 39 30 39 30  31 32 30 31 35 31 31 38  |3105909012015118|
00000d90  31 32 31 32 32 34 33 32  37 33 33 30 34 33 33 34  |1212243273304334|
00000da0  33 36 37 22 2c 4d 25 2c  33 29 2d 28 4c 25 80 4d  |367",M%,3)-(L%.M|
00000db0  25 3e 33 29 0d 04 38 0b  3d 4d 25 81 33 2b 31 0d  |%>3)..8.=M%.3+1.|
00000dc0  04 42 05 20 0d 04 4c 31  dd a4 6e 64 61 79 28 44  |.B. ..L1..nday(D|
00000dd0  25 29 3d 44 25 2b 31 2d  a4 64 61 79 73 28 31 2c  |%)=D%+1-.days(1,|
00000de0  a4 6e 6d 6f 6e 28 44 25  29 2c a4 6e 79 65 61 72  |.nmon(D%),.nyear|
00000df0  28 44 25 29 29 0d 04 56  04 0d 04 60 27 dd f2 65  |(D%))..V...`'..e|
00000e00  78 70 64 61 74 65 28 54  25 2c f8 20 44 25 2c f8  |xpdate(T%,. D%,.|
00000e10  20 4d 25 2c f8 20 59 25  29 3a ea 4c 25 2c 55 25  | M%,. Y%):.L%,U%|
00000e20  0d 04 6a 40 59 25 3d a4  6e 79 65 61 72 28 54 25  |..j@Y%=.nyear(T%|
00000e30  29 3a 55 25 3d 54 25 2d  a4 64 61 79 73 28 31 2c  |):U%=T%-.days(1,|
00000e40  31 2c 59 25 29 3a 4c 25  3d a4 6c 65 61 70 28 59  |1,Y%):L%=.leap(Y|
00000e50  25 29 3a 4d 25 3d 2d 32  3a f5 3a 4d 25 2b 3d 33  |%):M%=-2:.:M%+=3|
00000e60  0d 04 74 40 fd 55 25 3c  bb c1 22 30 33 31 30 35  |..t@.U%<.."03105|
00000e70  39 30 39 30 31 32 30 31  35 31 31 38 31 32 31 32  |9090120151181212|
00000e80  32 34 33 32 37 33 33 30  34 33 33 34 33 36 37 22  |243273304334367"|
00000e90  2c 4d 25 2c 33 29 2d 28  4c 25 80 4d 25 3e 33 29  |,M%,3)-(L%.M%>3)|
00000ea0  0d 04 7e 26 4d 25 3d 4d  25 81 33 2b 31 3a 44 25  |..~&M%=M%.3+1:D%|
00000eb0  3d 54 25 2b 31 2d a4 64  61 79 73 28 31 2c 4d 25  |=T%+1-.days(1,M%|
00000ec0  2c 59 25 29 3a e1 0d 04  88 04 0d 04 92 21 dd a4  |,Y%):........!..|
00000ed0  73 79 65 61 72 28 59 25  29 3d 22 20 22 2b c2 22  |syear(Y%)=" "+."|
00000ee0  30 30 30 22 2b c3 59 25  2c 34 29 0d 04 9c 04 0d  |000"+.Y%,4).....|
00000ef0  04 a6 17 dd a4 73 6d 6f  6e 28 4d 25 29 3d a4 6d  |.....smon(M%)=.m|
00000f00  6f 6e 28 4d 25 29 0d 04  b0 04 0d 04 ba 18 dd a4  |on(M%)..........|
00000f10  64 32 28 54 25 29 3d c2  22 30 22 2b c3 54 25 2c  |d2(T%)=."0"+.T%,|
00000f20  32 29 0d 04 c4 04 0d 04  ce 28 dd a4 6c 65 61 70  |2).......(..leap|
00000f30  28 59 25 29 3d 59 25 83  34 3d 30 80 59 25 83 31  |(Y%)=Y%.4=0.Y%.1|
00000f40  30 30 3c 3e 30 84 59 25  83 34 30 30 3d 30 0d 04  |00<>0.Y%.400=0..|
00000f50  d8 04 0d 04 e2 31 dd a4  73 74 72 64 61 74 65 28  |.....1..strdate(|
00000f60  55 25 2c 4d 25 2c 59 25  2c 54 25 29 3a ea 44 25  |U%,M%,Y%,T%):.D%|
00000f70  3a 44 25 3d a4 64 61 79  73 28 55 25 2c 4d 25 2c  |:D%=.days(U%,M%,|
00000f80  59 25 29 0d 04 ec 35 dd  a4 73 74 72 64 61 74 65  |Y%)...5..strdate|
00000f90  31 28 44 25 2c 54 25 29  3a ea 55 25 2c 4d 25 2c  |1(D%,T%):.U%,M%,|
00000fa0  59 25 3a f2 65 78 70 64  61 74 65 28 44 25 2c 55  |Y%:.expdate(D%,U|
00000fb0  25 2c 4d 25 2c 59 25 29  0d 04 f6 13 e7 44 25 3c  |%,M%,Y%).....D%<|
00000fc0  31 3a 3d 22 45 72 72 6f  72 21 22 0d 05 00 09 c8  |1:="Error!".....|
00000fd0  8e 54 25 ca 0d 05 0a 40  c9 31 3a 3d a4 77 64 61  |.T%....@.1:=.wda|
00000fe0  79 28 44 25 29 2b 22 20  22 2b c3 55 25 2b a4 63  |y(D%)+" "+.U%+.c|
00000ff0  61 72 64 69 6e 61 6c 28  55 25 29 2b 22 20 22 2b  |ardinal(U%)+" "+|
00001000  a4 73 6d 6f 6e 28 4d 25  29 2b a4 73 79 65 61 72  |.smon(M%)+.syear|
00001010  28 59 25 29 0d 05 14 2c  c9 32 3a 3d a4 6d 6f 6e  |(Y%)...,.2:=.mon|
00001020  33 28 4d 25 29 2b 22 20  22 2b c2 22 30 22 2b c3  |3(M%)+" "+."0"+.|
00001030  55 25 2c 32 29 2b a4 73  79 65 61 72 28 59 25 29  |U%,2)+.syear(Y%)|
00001040  0d 05 1e 32 c9 33 3a 3d  c3 55 25 2b a4 63 61 72  |...2.3:=.U%+.car|
00001050  64 69 6e 61 6c 28 55 25  29 2b 22 20 22 2b a4 6d  |dinal(U%)+" "+.m|
00001060  6f 6e 33 28 4d 25 29 2b  a4 73 79 65 61 72 28 59  |on3(M%)+.syear(Y|
00001070  25 29 0d 05 28 41 c9 34  3a 3d a4 77 64 61 79 33  |%)..(A.4:=.wday3|
00001080  28 44 25 29 2b 22 20 22  2b c3 55 25 2b a4 63 61  |(D%)+" "+.U%+.ca|
00001090  72 64 69 6e 61 6c 28 55  25 29 2b 22 20 22 2b a4  |rdinal(U%)+" "+.|
000010a0  6d 6f 6e 33 28 4d 25 29  2b a4 73 79 65 61 72 28  |mon3(M%)+.syear(|
000010b0  59 25 29 0d 05 32 27 c9  35 3a 3d a4 64 32 28 4d  |Y%)..2'.5:=.d2(M|
000010c0  25 29 2b 22 2f 22 2b a4  64 32 28 55 25 29 2b 22  |%)+"/"+.d2(U%)+"|
000010d0  2f 22 2b a4 64 32 28 59  25 29 0d 05 3c 59 c9 36  |/"+.d2(Y%)..<Y.6|
000010e0  3a 3d 22 54 68 65 20 22  2b a4 6e 75 6d 62 65 72  |:="The "+.number|
000010f0  74 68 28 55 25 29 2b 22  20 64 61 79 20 6f 66 20  |th(U%)+" day of |
00001100  22 2b a4 73 6d 6f 6e 28  4d 25 29 2b 22 20 69 6e  |"+.smon(M%)+" in|
00001110  20 74 68 65 20 79 65 61  72 20 6f 66 20 6f 75 72  | the year of our|
00001120  20 4c 6f 72 64 20 22 2b  a4 6e 75 6d 62 65 72 28  | Lord "+.number(|
00001130  59 25 29 0d 05 46 32 c9  37 3a 3d c3 55 25 2b a4  |Y%)..F2.7:=.U%+.|
00001140  63 61 72 64 69 6e 61 6c  28 55 25 29 2b 22 20 22  |cardinal(U%)+" "|
00001150  2b a4 73 6d 6f 6e 28 4d  25 29 2b a4 73 79 65 61  |+.smon(M%)+.syea|
00001160  72 28 59 25 29 0d 05 50  6f c9 38 3a 3d 22 54 68  |r(Y%)..Po.8:="Th|
00001170  65 20 22 2b a4 63 61 73  65 74 72 69 6d 28 a4 6e  |e "+.casetrim(.n|
00001180  75 6d 62 65 72 74 68 28  55 25 29 29 2b 22 20 64  |umberth(U%))+" d|
00001190  61 79 20 6f 66 20 22 2b  a4 73 6d 6f 6e 28 4d 25  |ay of "+.smon(M%|
000011a0  29 2b 22 20 69 6e 20 74  68 65 20 79 65 61 72 20  |)+" in the year |
000011b0  6f 66 20 6f 75 72 20 4c  6f 72 64 20 22 2b a4 63  |of our Lord "+.c|
000011c0  61 73 65 74 72 69 6d 28  a4 6e 75 6d 62 65 72 28  |asetrim(.number(|
000011d0  59 25 29 29 0d 05 5a 22  c9 31 30 3a 3d a4 64 32  |Y%))..Z".10:=.d2|
000011e0  28 55 25 29 2b a4 6d 6f  6e 33 28 4d 25 29 2b a4  |(U%)+.mon3(M%)+.|
000011f0  64 32 28 59 25 29 0d 05  64 20 c9 31 31 3a 3d a4  |d2(Y%)..d .11:=.|
00001200  64 32 28 55 25 29 2b a4  64 32 28 4d 25 29 2b a4  |d2(U%)+.d2(M%)+.|
00001210  64 32 28 59 25 29 0d 05  6e 25 c9 31 32 3a 3d c3  |d2(Y%)..n%.12:=.|
00001220  55 25 2b 22 20 22 2b a4  6d 6f 6e 33 28 4d 25 29  |U%+" "+.mon3(M%)|
00001230  2b a4 73 79 65 61 72 28  59 25 29 0d 05 78 05 cb  |+.syear(Y%)..x..|
00001240  0d 05 82 24 3d a4 64 32  28 55 25 29 2b 22 2f 22  |...$=.d2(U%)+"/"|
00001250  2b a4 64 32 28 4d 25 29  2b 22 2f 22 2b a4 64 32  |+.d2(M%)+"/"+.d2|
00001260  28 59 25 29 0d 05 8c 04  0d 05 96 2e dd a4 6e 6f  |(Y%)..........no|
00001270  77 3a ea 54 25 2c 44 25  2c 4d 25 2c 59 25 3a 54  |w:.T%,D%,M%,Y%:T|
00001280  25 3d e0 2b 31 3a 3f 54  25 3d 31 3a c8 99 20 37  |%=.+1:?T%=1:.. 7|
00001290  2c 31 34 2c 54 25 0d 05  a0 39 44 25 3d bb c3 7e  |,14,T%...9D%=..~|
000012a0  54 25 3f 32 3a 4d 25 3d  bb c3 7e 54 25 3f 31 3a  |T%?2:M%=..~T%?1:|
000012b0  59 25 3d 31 39 30 30 2b  bb c3 7e 3f 54 25 3a 3d  |Y%=1900+..~?T%:=|
000012c0  a4 64 61 79 73 28 44 25  2c 4d 25 2c 59 25 29 0d  |.days(D%,M%,Y%).|
000012d0  05 aa 04 0d 05 b4 2d dd  a4 72 65 61 64 64 61 74  |......-..readdat|
000012e0  65 28 54 24 29 3a ea 44  25 2c 4d 25 2c 59 25 2c  |e(T$):.D%,M%,Y%,|
000012f0  54 25 2c 4d 24 3a 54 24  3d a4 73 75 28 54 24 29  |T%,M$:T$=.su(T$)|
00001300  0d 05 be 25 4d 24 3d 22  4d 4f 4e 2e 54 55 45 2e  |...%M$="MON.TUE.|
00001310  57 45 44 2e 54 48 55 2e  46 52 49 2e 53 41 54 2e  |WED.THU.FRI.SAT.|
00001320  53 55 4e 2e 22 0d 05 c8  2e e7 a7 4d 24 2c c0 54  |SUN."......M$,.T|
00001330  24 2c 33 29 2b 22 2e 22  29 3a f5 54 24 3d c1 54  |$,3)+"."):.T$=.T|
00001340  24 2c 32 29 3a fd 97 54  24 3c 36 35 84 97 54 24  |$,2):..T$<65..T$|
00001350  3e 39 30 0d 05 d2 2c c8  95 28 97 54 24 3e 2d 31  |>90...,..(.T$>-1|
00001360  80 97 54 24 3c 34 38 29  84 28 97 54 24 3e 35 37  |..T$<48).(.T$>57|
00001370  80 97 54 24 3c 36 35 29  84 97 54 24 3e 39 30 0d  |..T$<65)..T$>90.|
00001380  05 dc 0f 54 24 3d c1 54  24 2c 32 29 3a ce 0d 05  |...T$=.T$,2):...|
00001390  e6 39 4d 24 3d 22 4a 41  4e 2e 46 45 42 2e 4d 41  |.9M$="JAN.FEB.MA|
000013a0  52 2e 41 50 52 2e 4d 41  59 2e 4a 55 4e 2e 4a 55  |R.APR.MAY.JUN.JU|
000013b0  4c 2e 41 55 47 2e 53 45  50 2e 4f 43 54 2e 4e 4f  |L.AUG.SEP.OCT.NO|
000013c0  56 2e 44 45 43 2e 22 0d  05 f0 4f e7 bb 54 24 3e  |V.DEC."...O..T$>|
000013d0  3d 31 30 31 30 30 3a e7  c3 bb 54 24 3d c2 54 24  |=10100:...T$=.T$|
000013e0  2c a9 c3 bb 54 24 29 3a  3d a4 64 61 79 73 28 bb  |,...T$):=.days(.|
000013f0  c0 54 24 2c a9 54 24 2d  34 29 2c bb c1 54 24 2c  |.T$,.T$-4),..T$,|
00001400  a9 54 24 2d 33 2c 32 29  2c 31 39 30 30 2b bb c2  |.T$-3,2),1900+..|
00001410  54 24 2c 32 29 29 0d 05  fa 0b e7 bb 54 24 3d 30  |T$,2))......T$=0|
00001420  8c 0d 06 04 1f 4d 25 3d  a7 4d 24 2c c0 54 24 2c  |.....M%=.M$,.T$,|
00001430  33 29 2b 22 2e 22 29 3a  e7 4d 25 3d 30 3a 3d 30  |3)+"."):.M%=0:=0|
00001440  0d 06 0e 1b 54 24 3d c1  54 24 2c 34 29 3a 4d 25  |....T$=.T$,4):M%|
00001450  3d 28 4d 25 2d 31 29 81  34 2b 31 0d 06 18 30 c8  |=(M%-1).4+1...0.|
00001460  95 28 97 54 24 3c 34 38  84 97 54 24 3e 35 37 29  |.(.T$<48..T$>57)|
00001470  80 97 54 24 3c 3e 34 33  80 54 24 3c 3e 22 22 3a  |..T$<>43.T$<>"":|
00001480  54 24 3d c1 54 24 2c 32  29 3a ce 0d 06 22 21 44  |T$=.T$,2):..."!D|
00001490  25 3d a4 69 6e 70 6e 75  6d 28 54 24 29 3a e7 44  |%=.inpnum(T$):.D|
000014a0  25 3c 31 84 44 25 3e 33  31 3a 3d 30 0d 06 2c 05  |%<1.D%>31:=0..,.|
000014b0  cc 0d 06 36 21 44 25 3d  a4 69 6e 70 6e 75 6d 28  |...6!D%=.inpnum(|
000014c0  54 24 29 3a e7 44 25 3c  31 84 44 25 3e 33 31 3a  |T$):.D%<1.D%>31:|
000014d0  3d 30 0d 06 40 0f 4d 25  3d 30 3a c8 95 4d 25 3d  |=0..@.M%=0:..M%=|
000014e0  30 0d 06 4a 1d e7 54 24  3d 22 22 84 28 97 54 24  |0..J..T$="".(.T$|
000014f0  3e 3d 34 38 80 97 54 24  3c 3d 35 37 29 8c 0d 06  |>=48..T$<=57)...|
00001500  54 2d 4d 25 3d a4 69 6e  70 6e 75 6d 28 54 24 29  |T-M%=.inpnum(T$)|
00001510  3a e7 4d 25 3c 31 84 4d  25 3e 31 32 3a 4d 25 3d  |:.M%<1.M%>12:M%=|
00001520  a4 6e 6d 6f 6e 28 a4 6e  6f 77 29 0d 06 5e 05 cc  |.nmon(.now)..^..|
00001530  0d 06 68 33 4d 25 3d a7  4d 24 2c c0 54 24 2c 33  |..h3M%=.M$,.T$,3|
00001540  29 2b 22 2e 22 29 3a e7  4d 25 3e 30 54 24 3d c1  |)+"."):.M%>0T$=.|
00001550  54 24 2c 34 29 3a 4d 25  3d 28 4d 25 2d 31 29 81  |T$,4):M%=(M%-1).|
00001560  34 2b 31 0d 06 72 15 cd  3a e7 4d 25 3d 30 3a 54  |4+1..r..:.M%=0:T|
00001570  24 3d c1 54 24 2c 32 29  0d 06 7c 05 ce 0d 06 86  |$=.T$,2)..|.....|
00001580  05 cd 0d 06 90 30 c8 95  28 97 54 24 3c 34 38 84  |.....0..(.T$<48.|
00001590  97 54 24 3e 35 37 29 80  97 54 24 3c 3e 34 33 80  |.T$>57)..T$<>43.|
000015a0  54 24 3c 3e 22 22 3a 54  24 3d c1 54 24 2c 32 29  |T$<>"":T$=.T$,2)|
000015b0  3a ce 0d 06 9a 35 54 25  3d 97 54 24 3a 59 25 3d  |:....5T%=.T$:Y%=|
000015c0  a4 69 6e 70 6e 75 6d 28  54 24 29 3a e7 59 25 3c  |.inpnum(T$):.Y%<|
000015d0  31 30 30 80 59 25 3e 30  80 54 25 3c 3e 34 33 59  |100.Y%>0.T%<>43Y|
000015e0  25 2b 3d 31 39 30 30 0d  06 a4 1f e7 59 25 3d 30  |%+=1900.....Y%=0|
000015f0  80 54 25 3c 3e 34 33 59  25 3d a4 6e 79 65 61 72  |.T%<>43Y%=.nyear|
00001600  28 a4 6e 6f 77 29 0d 06  ae 14 3d a4 64 61 79 73  |(.now)....=.days|
00001610  28 44 25 2c 4d 25 2c 59  25 29 0d 06 b8 04 0d 06  |(D%,M%,Y%)......|
00001620  c2 1d dd a4 69 6e 70 6e  75 6d 28 f8 20 54 24 29  |....inpnum(. T$)|
00001630  3a ea 54 25 3a 54 25 3d  bb 54 24 0d 06 cc 2e c8  |:.T%:T%=.T$.....|
00001640  95 97 54 24 3d 34 33 84  28 97 54 24 3e 3d 34 38  |..T$=43.(.T$>=48|
00001650  80 97 54 24 3c 3d 35 37  29 3a 54 24 3d c1 54 24  |..T$<=57):T$=.T$|
00001660  2c 32 29 3a ce 3a 3d 54  25 0d 06 d6 04 0d 06 e0  |,2):.:=T%.......|
00001670  2a dd a4 70 28 54 24 29  3a ea 49 25 3a 49 25 3d  |*..p(T$):.I%:I%=|
00001680  a7 54 24 2c 22 2e 22 29  3a e7 49 25 3d 30 3a 49  |.T$,"."):.I%=0:I|
00001690  25 3d a9 54 24 2b 31 0d  06 ea 22 3d bb 28 c0 54  |%=.T$+1..."=.(.T|
000016a0  24 2c 49 25 2d 31 29 2b  c1 54 24 2b 22 30 30 22  |$,I%-1)+.T$+"00"|
000016b0  2c 49 25 2b 31 2c 32 29  29 0d 06 f4 04 0d 06 fe  |,I%+1,2)).......|
000016c0  2b dd a4 60 28 54 25 29  3a ea 54 24 3a 54 24 3d  |+..`(T%):.T$:T$=|
000016d0  c3 54 25 3a e7 97 54 24  3c 3e 97 22 2d 22 3a 54  |.T%:..T$<>."-":T|
000016e0  24 3d 22 20 22 2b 54 24  0d 07 08 32 c8 95 a9 54  |$=" "+T$...2...T|
000016f0  24 3c 33 3a 54 24 3d c0  54 24 29 2b 22 30 22 2b  |$<3:T$=.T$)+"0"+|
00001700  c1 54 24 2c 32 29 3a ce  3a e7 97 54 24 3d 33 32  |.T$,2):.:..T$=32|
00001710  3a 54 24 3d c1 54 24 2c  32 29 0d 07 12 1a 3d c0  |:T$=.T$,2)....=.|
00001720  54 24 2c a9 54 24 2d 32  29 2b 22 2e 22 2b c2 54  |T$,.T$-2)+"."+.T|
00001730  24 2c 32 29 0d 07 1c 04  0d 07 26 0c dd a4 6e 75  |$,2)......&...nu|
00001740  6d 28 61 29 0d 07 30 13  ea 40 25 3a 40 25 3d 26  |m(a)..0..@%:@%=&|
00001750  31 30 32 30 32 30 43 0d  07 3a 19 3d c2 22 20 20  |102020C..:.=."  |
00001760  20 20 20 20 20 20 20 20  22 2b c3 61 2c 31 32 29  |        "+.a,12)|
00001770  0d 07 44 04 0d 07 4e 25  dd a4 66 69 6c 65 76 61  |..D...N%..fileva|
00001780  72 28 54 24 29 3a c8 99  73 77 69 25 2c 73 64 35  |r(T$):..swi%,sd5|
00001790  37 5f 25 2c 54 24 b8 47  25 0d 07 58 07 3d 47 25  |7_%,T$.G%..X.=G%|
000017a0  0d 07 62 04 0d 07 6c 1d  dd a4 63 61 73 65 74 72  |..b...l...casetr|
000017b0  69 6d 28 54 24 29 3a e7  54 24 3d 22 22 3a 3d 22  |im(T$):.T$="":="|
000017c0  22 0d 07 76 1c ea 46 25  2c 49 25 2c 43 25 3a 46  |"..v..F%,I%,C%:F|
000017d0  25 3d b9 3a e3 49 25 3d  31 b8 a9 54 24 0d 07 80  |%=.:.I%=1..T$...|
000017e0  14 43 25 3d 97 c1 54 24  2c 49 25 29 3a e7 46 25  |.C%=..T$,I%):.F%|
000017f0  8c 0d 07 8a 23 e7 43 25  3e 39 36 80 43 25 3c 31  |....#.C%>96.C%<1|
00001800  32 33 c1 54 24 2c 49 25  2c 31 29 3d bd 28 43 25  |23.T$,I%,1)=.(C%|
00001810  2d 33 32 29 0d 07 94 05  cc 0d 07 9e 22 e7 43 25  |-32)........".C%|
00001820  3e 36 34 80 43 25 3c 39  31 c1 54 24 2c 49 25 2c  |>64.C%<91.T$,I%,|
00001830  31 29 3d bd 28 43 25 2b  33 32 29 0d 07 a8 05 cd  |1)=.(C%+32).....|
00001840  0d 07 b2 12 46 25 3d 43  25 3d 33 32 3a ed 3a 3d  |....F%=C%=32:.:=|
00001850  54 24 0d 07 bc 04 0d 07  c6 58 dd f2 6c 64 5f 69  |T$.......X..ld_i|
00001860  6e 69 74 3a 6c 64 5f 6d  61 78 6c 65 6e 25 3d 32  |nit:ld_maxlen%=2|
00001870  35 3a 6c 64 5f 61 64 64  25 3d 31 3a 6c 64 5f 63  |5:ld_add%=1:ld_c|
00001880  68 67 25 3d 32 3a 6c 64  5f 64 65 6c 25 3d 32 3a  |hg%=2:ld_del%=2:|
00001890  de 20 6c 64 25 28 6c 64  5f 6d 61 78 6c 65 6e 25  |. ld%(ld_maxlen%|
000018a0  2c 6c 64 5f 6d 61 78 6c  65 6e 25 29 3a e1 0d 07  |,ld_maxlen%):...|
000018b0  d0 04 0d 07 da 24 dd a4  64 69 66 66 65 72 65 6e  |.....$..differen|
000018c0  63 65 28 52 24 2c 46 24  29 3a ea 49 25 2c 4a 25  |ce(R$,F$):.I%,J%|
000018d0  2c 52 25 2c 46 25 0d 07  e4 2f 6c 64 5f 6d 61 78  |,R%,F%.../ld_max|
000018e0  6c 65 6e 25 3d 6c 64 5f  6d 61 78 6c 65 6e 25 3a  |len%=ld_maxlen%:|
000018f0  e7 6c 64 5f 6d 61 78 6c  65 6e 25 3d 30 f2 6c 64  |.ld_maxlen%=0.ld|
00001900  5f 69 6e 69 74 0d 07 ee  26 52 25 3d a9 52 24 3a  |_init...&R%=.R$:|
00001910  e7 52 25 3e 6c 64 5f 6d  61 78 6c 65 6e 25 52 25  |.R%>ld_maxlen%R%|
00001920  3d 6c 64 5f 6d 61 78 6c  65 6e 25 0d 07 f8 26 46  |=ld_maxlen%...&F|
00001930  25 3d a9 46 24 3a e7 46  25 3e 6c 64 5f 6d 61 78  |%=.F$:.F%>ld_max|
00001940  6c 65 6e 25 46 25 3d 6c  64 5f 6d 61 78 6c 65 6e  |len%F%=ld_maxlen|
00001950  25 0d 08 02 0e 6c 64 25  28 30 2c 30 29 3d 30 0d  |%....ld%(0,0)=0.|
00001960  08 0c 34 e3 4a 25 3d 31  b8 6c 64 5f 6d 61 78 6c  |..4.J%=1.ld_maxl|
00001970  65 6e 25 3a 6c 64 25 28  30 2c 4a 25 29 3d 6c 64  |en%:ld%(0,J%)=ld|
00001980  25 28 30 2c 4a 25 2d 31  29 2b 6c 64 5f 61 64 64  |%(0,J%-1)+ld_add|
00001990  25 3a ed 0d 08 16 34 e3  4a 25 3d 31 b8 6c 64 5f  |%:....4.J%=1.ld_|
000019a0  6d 61 78 6c 65 6e 25 3a  6c 64 25 28 4a 25 2c 30  |maxlen%:ld%(J%,0|
000019b0  29 3d 6c 64 25 28 4a 25  2d 31 2c 30 29 2b 6c 64  |)=ld%(J%-1,0)+ld|
000019c0  5f 64 65 6c 25 3a ed 0d  08 20 15 e3 49 25 3d 31  |_del%:... ..I%=1|
000019d0  b8 52 25 3a e3 4a 25 3d  31 b8 46 25 0d 08 2a 61  |.R%:.J%=1.F%..*a|
000019e0  6c 64 25 28 49 25 2c 4a  25 29 3d a4 6c 64 5f 73  |ld%(I%,J%)=.ld_s|
000019f0  6d 61 6c 6c 28 6c 64 25  28 49 25 2d 31 2c 4a 25  |mall(ld%(I%-1,J%|
00001a00  2d 31 29 2b a4 6c 64 5f  7a 65 71 28 49 25 2c 4a  |-1)+.ld_zeq(I%,J|
00001a10  25 29 2c 6c 64 25 28 49  25 2c 4a 25 2d 31 29 2b  |%),ld%(I%,J%-1)+|
00001a20  6c 64 5f 61 64 64 25 2c  6c 64 25 28 49 25 2d 31  |ld_add%,ld%(I%-1|
00001a30  2c 4a 25 29 2b 6c 64 5f  64 65 6c 25 29 0d 08 34  |,J%)+ld_del%)..4|
00001a40  07 ed 3a ed 0d 08 3e 0f  3d 6c 64 25 28 52 25 2c  |..:...>.=ld%(R%,|
00001a50  46 25 29 0d 08 48 04 0d  08 52 18 dd a4 6c 64 5f  |F%)..H...R...ld_|
00001a60  73 6d 61 6c 6c 28 58 25  2c 59 25 2c 5a 25 29 0d  |small(X%,Y%,Z%).|
00001a70  08 5c 0b e7 58 25 3c 59  25 8c 0d 08 66 0e e7 58  |.\..X%<Y%...f..X|
00001a80  25 3c 5a 25 3a 3d 58 25  0d 08 70 05 cc 0d 08 7a  |%<Z%:=X%..p....z|
00001a90  0e e7 59 25 3c 5a 25 3a  3d 59 25 0d 08 84 05 cd  |..Y%<Z%:=Y%.....|
00001aa0  0d 08 8e 07 3d 5a 25 0d  08 98 04 0d 08 a2 35 dd  |....=Z%.......5.|
00001ab0  a4 6c 64 5f 7a 65 71 28  58 25 2c 59 25 29 3a e7  |.ld_zeq(X%,Y%):.|
00001ac0  c1 52 24 2c 58 25 2c 31  29 3d c1 46 24 2c 59 25  |.R$,X%,1)=.F$,Y%|
00001ad0  2c 31 29 3a 3d 30 3a 8b  3d 6c 64 5f 63 68 67 25  |,1):=0:.=ld_chg%|
00001ae0  0d 08 ac 04 0d 08 b6 18  dd a4 73 69 6d 69 6c 61  |..........simila|
00001af0  72 28 52 24 2c 46 24 29  3a ea 54 25 0d 08 c0 2f  |r(R$,F$):.T%.../|
00001b00  6c 64 5f 6d 61 78 6c 65  6e 25 3d 6c 64 5f 6d 61  |ld_maxlen%=ld_ma|
00001b10  78 6c 65 6e 25 3a e7 6c  64 5f 6d 61 78 6c 65 6e  |xlen%:.ld_maxlen|
00001b20  25 3d 30 f2 6c 64 5f 69  6e 69 74 0d 08 ca 24 54  |%=0.ld_init...$T|
00001b30  25 3d 28 a9 52 24 2b 32  29 2f 34 2b 31 3a e7 94  |%=(.R$+2)/4+1:..|
00001b40  28 a9 52 24 2d a9 46 24  29 3e 54 25 3a 3d a3 0d  |(.R$-.F$)>T%:=..|
00001b50  08 d4 26 54 25 3d a9 52  24 3a e7 54 25 3e 6c 64  |..&T%=.R$:.T%>ld|
00001b60  5f 6d 61 78 6c 65 6e 25  54 25 3d 6c 64 5f 6d 61  |_maxlen%T%=ld_ma|
00001b70  78 6c 65 6e 25 0d 08 de  2a 54 25 3d 28 a9 52 24  |xlen%...*T%=(.R$|
00001b80  2b 32 29 2f 34 2b 31 3a  3d a4 64 69 66 66 65 72  |+2)/4+1:=.differ|
00001b90  65 6e 63 65 28 52 24 2c  46 24 29 3c 3d 54 25 0d  |ence(R$,F$)<=T%.|
00001ba0  08 e8 04 0d 08 f2 48 2d  42 41 53 45 20 46 55 4e  |......H-BASE FUN|
00001bb0  43 54 49 4f 4e 53 20 e0  2d 2d 2d 2d 2d 2d 2d 2d  |CTIONS .--------|
00001bc0  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |----------------|
*
00001be0  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 0d ff           |-----------..|
00001bed