home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Chip 1999 September
/
Chip_1999-09_cd.bin
/
ctenari
/
Trejbal
/
TRELL.PAK
/
SOURCE
/
ERSD.EXE
/
KOLBEX.PAS
< prev
next >
Wrap
Pascal/Delphi Source File
|
1999-01-13
|
3KB
|
250 lines
uses dos,crt,slova;
var i,j,par,k,l,m,n,o,coko : integer;
radk,rad,kus,sfs,para,parb : string;
paka : string[6];
aa,bb,cc,ee,ff,gg,hh,ii:text;
znak:array [0..7] of char;
zaka:array [0..5] of char;
zakk,alla : char;
procedure prepis;
begin
if para='0780' then
begin
znak[5]:=znak[1];
znak[1]:=znak[2];
znak[2]:=znak[4];
znak[4]:=znak[3];
znak[3]:=znak[5];
end; { konec }
if para='0782' then
begin
znak[5]:=znak[1];
znak[1]:=znak[3];
znak[3]:=znak[4];
znak[4]:=znak[2];
znak[2]:=znak[5];
end; { konec }
i:=0;
write(bb,znak[1]);
write(bb,znak[2]);
write(bb,znak[3]);
write(bb,znak[4]);
end; { konec procedury }
procedure preved;
var code : integer;
begin
assign(aa,parb);
assign(bb,'ekiypo');
sfs:=fsearch(parb,GetEnv('path'));
if not(sfs='') then
begin
reset(aa);
rewrite(bb);
if para='0780' then
begin
write(bb,'Kolben');
end;
if para='0782' then
begin
for i:=1 to 6 do read(aa,zakk);
end;
i:=0;
k:=0;
l:=0;
while k=0 do
begin
if i>3 then prepis;
j:=0;
while l>0 do
begin
j:=j+1;
i:=i+1;
znak[i]:=zaka[j];
l:=l-1;
if i>3 then prepis;
end;
i:=i+1;
read(aa,znak[i]);
if eof(aa) then
begin
l:=l+1;
read(aa,zaka[l]);
if eof(aa) then
begin
l:=l+1;
read(aa,zaka[l]);
if eof(aa) then
begin
l:=l+1;
read(aa,zaka[l]);
if eof(aa) then k:=1;
end;
end;
end;
end;
if i>0 then
begin
for j:=1 to i do write(bb,znak[j]);
end;
close(bb);
close(aa);
{
write('kkkkkk');
readln;
}
reset(bb);
rewrite(aa);
k:=0;
l:=0;
while k=0 do
begin
j:=0;
while l>0 do
begin
j:=j+1;
write(aa,znak[j+1]);
l:=l-1;
end;
read(bb,znak[1]);
write(aa,znak[1]);
if eof(bb) then
begin
l:=l+1;
read(bb,znak[2]);
if eof(bb) then
begin
l:=l+1;
read(bb,znak[3]);
if eof(bb) then
begin
l:=l+1;
read(bb,znak[4]);
if eof(bb) then
begin
k:=1;
end;
end;
end;
end;
end;
close(bb);
if para='0782' then write(aa,chr(26));
close(aa);
erase(bb);
end;
end; { konec procedury }
begin
par:=paramcount;
para:=paramstr(1);
{ par:=2;
para:='0780';
parb:='b.zip';
}
if par>0 then
begin
textcolor(7);
textbackground(1);
cls;
dd[1]:='Ukládám data, vyçkejte..';
oknno(0,0,1,1);
soubory('c:\trell\data\*.dbf','c:\hubla',1);
assign(hh,'c:\hubla');
reset(hh);
while not(eof(hh)) do
begin
readln(hh,parb);
parb:='C:\trell\data\'+parb;
assign(ii,parb);
reset(ii);
read(ii,paka);
close(ii);
if paka='Kolben' then
begin
if para='0782' then preved;
end
else
begin
if para='0780' then preved;
end;
end;
close(hh);
erase(hh);
end;
end.