home *** CD-ROM | disk | FTP | other *** search
- unit Odkaz;
-
- interface
- const max=32767;
- var pole:array[1..max] of Char;
- zkratky:array[0..2] of String;
- od,i,index,kapitola,pocet,vers,uk1,uk2:Integer;
- pom,ret,ret2,VstupniSoubor,VystupniSoubor:String;
- f:File;
- g:Text;
- cesta,prvni:Boolean;
-
- function DalsiPolozku:Boolean;
- procedure VypisPolozku;
- function ZjistiPolozku:String;
- function Najdi(co:String):Boolean;
- function JeToCislo(co:String):Boolean;
- function JeToZkratka(co:String):Boolean;
- function ZapisOdkaz:Byte;
- function ZapisOdkaz2:Byte;
- function Zapis2(do0:Integer;odkaz:Byte):Integer;
- function JeToNazev(co:String):String;
-
- implementation
- uses Fr_Sok,Pomocne;
-
- function DalsiPolozku:Boolean;
- var i:Integer;
- begin
- if (uk2>=pocet) then
- begin
- DalsiPolozku:=False;
- end else begin
- for i:=uk2+2 to pocet do
- begin
- if (pole[i]=' ') or (pole[i]='<') or (pole[i]='(') or (pole[i]=')') or (pole[i]=';') then
- begin
- if (uk2<1) then begin uk1:=1;uk2:=i-1;break;end else begin uk1:=uk2+2;uk2:=i-1;break;end;
- end;
- end;
- if (i=pocet) {cyklus do¿el nakonec souboru} then uk2:=pocet;
- DalsiPolozku:=True;
- end;
- end;
-
- procedure VypisPolozku;
- var i:Integer;
- begin
- Write('"');
- for i:=uk1 to uk2 do Write(pole[i]);
- Writeln('"');
- end;
-
- function ZjistiPolozku:String;
- var pom:String;
- znak:Char;
- i:Integer;
- begin
- pom:='';
- for i:=uk1 to uk2 do pom:=pom+pole[i];
- ZjistiPolozku:=pom;
- end;
-
- function Najdi(co:String):Boolean;
- var i:Integer;
- begin
- for i:=0 to 2 do if Pos(Prevod(co,3,4),Zkratky[i])>0 then begin Najdi:=True;Exit;end;
- Najdi:=False;
- end;
-
- function JeToCislo(co:String):Boolean;
- var p:Word;
- i:Integer;
- begin
- System.Val(co,p,i);JeToCislo:=(i=0);
- end;
-
- function JeToZkratka(co:String):Boolean;
- begin
- JeToZkratka:=Najdi(' '+OdstranZbytecneMezery(co)+' ');
- end;
-
- function ZapisOdkaz:Byte;
- var s,t:String;
- begin
- s:='<A HREF="';
- if cesta then s:=s+'http://www-troja.fjfi.cvut.cz/~sokolovs/BIBLE/';
- s:=s+UpCaseString(Prevod(ret,3,4))+'.HTM';
- if kapitola>0 then s:=s+'#'+Str(kapitola);
- if vers>0 then s:=s+':'+Str(vers);
- t:=ret;
- if (kapitola>0) then t:=t+' '+Str(kapitola);
- if (vers>0) then t:=t+','+Str(vers);
- s:=s+'">'+t+'</A>';
- Write(g,s);ZapisOdkaz:=Length(t);
- end;
-
- function ZapisOdkaz2:Byte;
- var s,t:String;
- begin
- s:='<A HREF="';
- if cesta then s:=s+'http://www-troja.fjfi.cvut.cz/~sokolovs/BIBLE/';
- s:=s+UpCaseString(Prevod(ret,3,4))+'.HTM';
- if kapitola>0 then s:=s+'#'+Str(kapitola);
- if vers>0 then s:=s+':'+Str(vers);
- t:=Str(vers);s:=s+'">'+t+'</A>';
- Write(g,s);ZapisOdkaz2:=Length(t);
- end;
-
- function Zapis2(do0:Integer;odkaz:Byte):Integer;
- var i,od0:Integer;
- begin od0:=od;
- if od0<=do0 then begin Zapis(g,pole[od0],do0-od0+1);Zapis2:=do0+1;end
- else begin
- for i:=do0-40 to od0+5 do Write(pole[i]);Cekej;
- Hlaseni('Zapis2 volána s parametry '+Str(od0)+','+Str(do0));Zapis2:=-1;
- end;
- if odkaz=1 then Inc(od,do0-od0+1+ZapisOdkaz);
- if odkaz=2 then Inc(od,do0-od0+1+ZapisOdkaz2);
- end;
-
- function JeToNazev(co:String):String;
- begin
- co:=Prevod(co,3,4);JeToNazev:='';
- if (co='Genesis') or (co='1.Mojzisova') then JeToNazev:='Gn';
- if (co='Exodus') or (co='2.Mojzisova') then JeToNazev:='Ex';
- if (co='Levitikus') or (co='3.Mojzisova') then JeToNazev:='Lv';
- if (co='Numeri') or (co='4.Mojzisova') then JeToNazev:='Nu';
- if (co='Deuteromium') or (co='5.Mojzisova') then JeToNazev:='Dt';
- if co='Jozue' then JeToNazev:='Joz';
- if co='Soudci' then JeToNazev:='Sd';
- if co='Rut' then JeToNazev:='Rt';
- if co='1.Samuelova' then JeToNazev:='1Sa';
- if co='2.Samuelova' then JeToNazev:='2Sa';
- if co='1.Kralovska' then JeToNazev:='1Kr';
- if co='2.Kralovska' then JeToNazev:='2Kr';
- if co='1.Paralipomenon' then JeToNazev:='1Pa';
- if co='2.Paralipomenon' then JeToNazev:='2Pa';
- if co='Ezdras' then JeToNazev:='Ezd';
- if co='Nehemias' then JeToNazev:='Neh';
- if co='Ester' then JeToNazev:='Est';
- if co='Job' then JeToNazev:='Jb';
- if co='Zalm' then JeToNazev:='Z';
- if co='Prislovi' then JeToNazev:='Pr';
- if co='Kazatel' then JeToNazev:='Kaz';
- if co='Pisen' then JeToNazev:='Pis';
- if co='Izaias' then JeToNazev:='Iz';
- if co='Jeremias' then JeToNazev:='Jr';
- if co='Plac' then JeToNazev:='Pl';
- if co='Ezechiel' then JeToNazev:='Ez';
- if co='Daniel' then JeToNazev:='Da';
- if co='Ozeas' then JeToNazev:='Oz';
- if co='Joel' then JeToNazev:='Jl';
- if co='Amos' then JeToNazev:='Am';
- if co='Abdias' then JeToNazev:='Abd';
- if co='Jonas' then JeToNazev:='Jon';
- if co='Micheas' then JeToNazev:='Mi';
- if co='Nahum' then JeToNazev:='Na';
- if co='Abakuk' then JeToNazev:='Abk';
- if co='Sofonias' then JeToNazev:='Sf';
- if co='Aggeus' then JeToNazev:='Ag';
- if co='Zacharias' then JeToNazev:='Za';
- if co='Malachias' then JeToNazev:='Mal';
- if co='Matous' then JeToNazev:='Mt';
- if co='Marek' then JeToNazev:='Mk';
- if co='Lukas' then JeToNazev:='Lk';
- if co='Jan' then JeToNazev:='J';
- if co='Skutky' then JeToNazev:='Sk';
- if co='Rimanum' then JeToNazev:='R';
- if co='1.Korintskym' then JeToNazev:='1K';
- if co='2.Korinrskym' then JeToNazev:='2K';
- if co='Galatskym' then JeToNazev:='Gal';
- if co='Efezskym' then JeToNazev:='Ef';
- if co='Filipenskym' then JeToNazev:='Fp';
- if co='Kolossenskym' then JeToNazev:='Ko';
- if co='1.Tesalonickym' then JeToNazev:='1Te';
- if co='2.Tesalonickym' then JeToNazev:='2Te';
- if co='1.Timoteovi' then JeToNazev:='1Tm';
- if co='2.Timoteovi' then JeToNazev:='2Tm';
- if co='Titovi' then JeToNazev:='Tt';
- if co='Filemonovi' then JeToNazev:='Fm';
- if co='Zidum' then JeToNazev:='Zd';
- if co='Jakub' then JeToNazev:='Jk';
- if co='1.Petra' then JeToNazev:='1Pt';
- if co='2.Petra' then JeToNazev:='2Pt';
- if co='1.Jan' then JeToNazev:='1J';
- if co='2.Jan' then JeToNazev:='2J';
- if co='3.Jan' then JeToNazev:='3J';
- if co='Juda' then JeToNazev:='Jud';
- if co='Zjeveni' then JeToNazev:='Zj';
- if co='Tobias' then JeToNazev:='Tob';
- if co='Judit' then JeToNazev:='Judit';
- if co='Moudrosti' then JeToNazev:='Mdr';
- if co='Sicharovec' then JeToNazev:='Si';
- if co='Baruk' then JeToNazev:='Bar';
- if co='1.Makabejska' then JeToNazev:='1Mak';
- if co='2.Makabejska' then JeToNazev:='2Mak';
- end;
-
-
-
- {Inicializaçní çást jednotky ODKAZ.PAS:}
- begin
- zkratky[0]:=' Abd Abk Ag Am Bar Daniel Da Dt Ef Ester Est Ex Ezd Ez Fp Fm Gal Gn Iz Jk J Jb Jl Jon Joz Jr Judit Jud ';
- zkratky[1]:=' Kaz Ko Lk Lv Mal Mk Mt Mdr Mi Na Neh Nu Oz Pis Pl Pr Rt R Sd Sf Si Sk Tt Tob Za Zd Zj Z ';
- zkratky[2]:=' 1J 1K 1Kr 1Mak 1Pa 1Pt 1S 1Te 1Tm 2J 2K 2Kr 2Mak 2Pa 2Pt 2S 2Te 2Tm 3Jan ';
- uk1:=1;uk2:=-1;od:=1;Vypni_Zvuk;stav:=Vypnuta;
- end.
-