H
huying
Unregistered / Unconfirmed
GUEST, unregistred user!
小地的垃圾代码.请大家先别骂小弟.程序的过程应该是没有问题,我前面注释掉的也没有问题,现在主要是进后面的循环,当(ByteArr[kuai*16384+15])= $ff 不成立.后面的循环一次后就死了.不知道为什么.救命啊!
procedure tform1.zhuan_huan();
var
f1:file;
targetcount,luyin:integer;
fffover,datalength_boo,fenkuai,fkuai:boolean;
kuer,kuer1,i,k:integer;
datalength:integer;
begin
luyin:=0;kuer1:=0;
fenkuai:=false; fkuai:=false;kuer:=0;
if (ByteArr[kuai*16384+2])<> $ff then
begin
while not fenkuai do
begin
if (ByteArr[kuai*16384+15])= $ff then
begin
if (ByteArr[kuai*16384-16384+15])= $ff then
begin
{ timedelay(5);
time_head_1();
ffcount:=0;
fffover:=false;
while not fffover do
begin
if ((ByteArr[(kuai+1)*16384-ffcount-1]) = $ff) then
begin
inc(ffcount);
end
else
fffover:=true;
end;
if fffover then
begin
setlength(Bin,16312-ffcount);
for i:=0 to (16311-ffcount) do
begin
Bin:=ByteArr[kuai*16384+i+72];
end;
dsq:='d:/WavFile/'+riqi+shijian+'.bin';
assignfile(f1,dsq);
rewrite(f1,1);
blockwrite(f1,Bin[0],16312-ffcount,targetcount);
closefile(f1);
setlength(Bin,0);
end; }
fenkuai:=true;
inc(kuai);
end
else
begin
timedelay(5);
ffcount:=0;
datalength_boo:=false;
while not datalength_boo do
begin
if ((ByteArr[(kuai+1)*16384-ffcount-1]) = $ff) then
inc(ffcount)
else
datalength_boo:=true;
end;
if ((ByteArr[kuai*16384+12])= 0) then
datalength:=16312-ffcount
else
datalength:=16344-ffcount;
data:=data+datalength;
if aaa=false then
begin
kuai:=kuai-kuer;
setlength(Bin,data+16);
fkuai:=false;
while not fkuai do
begin
if (ByteArr[(kuai)*16384+15])= $ff then
begin
if (ByteArr[(kuai)*16384-16438+15])<> $ff then
begin
datalength_boo:=false;
ffcount:=0;
while not datalength_boo do
begin
if ((ByteArr[(kuai+1)*16384-ffcount-1]) = $ff) then
inc(ffcount)
else
datalength_boo:=true;
end;
for i:=0 to 16343-ffcount do
Bin[kuer1+i]:=ByteArr[(kuai)*16384+i+40];
kuer1:=kuer1+16344-ffcount;
dsq:='d:/WavFile/'+riqi+shijian+'.bin';
assignfile(f1,dsq);
rewrite(f1,1);
blockwrite(f1,Bin[0],data,targetcount);
closefile(f1);
setlength(Bin,0);
inc(kuai);
kuer:=0;
kuer1:=0;
fkuai:=true;
fenkuai:=true;
aaa:=true;
data:=0;
//exit;
end;
end
else
begin
datalength_boo:=false;
ffcount:=0;
while not datalength_boo do
begin
if ((ByteArr[(kuai+1)*16384-ffcount-1]) = $ff) then
inc(ffcount)
else
datalength_boo:=true;
end;
if (ByteArr[(kuai)*16384+12])= $00 then
begin
time_head_1();
for i:=0 to 16311-ffcount do
Bin[kuer1+i]:=ByteArr[(kuai)*16384+i+72];
kuer1:=kuer1+16312-ffcount;
inc(kuai);
end
else
begin
for i:=0 to 16343-ffcount do
Bin[kuer1+i]:=ByteArr[(kuai)*16384+i+40];
kuer1:=kuer1+16344-ffcount;
inc(kuai);
end;
end;
end;
end;
fenkuai:=true;
end;
end
else
begin
aaa:=false;
ffcount:=0;
datalength:=0;
datalength_boo:=false;
while not datalength_boo do
begin
if ((ByteArr[(kuai+1)*16384-ffcount-1]) = $ff) then
inc(ffcount)
else
datalength_boo:=true
end;
if (ByteArr[kuai*16384+12])=$00 then
datalength:=16312-ffcount
else
datalength:=16344-ffcount;
data:=data+datalength;
inc(kuai);
inc(kuer);
end;
end;
end
else
begin
ffover:=true;
end;
timedelay(5);
if (ffover=false) then zhuan_huan();
end;
procedure tform1.zhuan_huan();
var
f1:file;
targetcount,luyin:integer;
fffover,datalength_boo,fenkuai,fkuai:boolean;
kuer,kuer1,i,k:integer;
datalength:integer;
begin
luyin:=0;kuer1:=0;
fenkuai:=false; fkuai:=false;kuer:=0;
if (ByteArr[kuai*16384+2])<> $ff then
begin
while not fenkuai do
begin
if (ByteArr[kuai*16384+15])= $ff then
begin
if (ByteArr[kuai*16384-16384+15])= $ff then
begin
{ timedelay(5);
time_head_1();
ffcount:=0;
fffover:=false;
while not fffover do
begin
if ((ByteArr[(kuai+1)*16384-ffcount-1]) = $ff) then
begin
inc(ffcount);
end
else
fffover:=true;
end;
if fffover then
begin
setlength(Bin,16312-ffcount);
for i:=0 to (16311-ffcount) do
begin
Bin:=ByteArr[kuai*16384+i+72];
end;
dsq:='d:/WavFile/'+riqi+shijian+'.bin';
assignfile(f1,dsq);
rewrite(f1,1);
blockwrite(f1,Bin[0],16312-ffcount,targetcount);
closefile(f1);
setlength(Bin,0);
end; }
fenkuai:=true;
inc(kuai);
end
else
begin
timedelay(5);
ffcount:=0;
datalength_boo:=false;
while not datalength_boo do
begin
if ((ByteArr[(kuai+1)*16384-ffcount-1]) = $ff) then
inc(ffcount)
else
datalength_boo:=true;
end;
if ((ByteArr[kuai*16384+12])= 0) then
datalength:=16312-ffcount
else
datalength:=16344-ffcount;
data:=data+datalength;
if aaa=false then
begin
kuai:=kuai-kuer;
setlength(Bin,data+16);
fkuai:=false;
while not fkuai do
begin
if (ByteArr[(kuai)*16384+15])= $ff then
begin
if (ByteArr[(kuai)*16384-16438+15])<> $ff then
begin
datalength_boo:=false;
ffcount:=0;
while not datalength_boo do
begin
if ((ByteArr[(kuai+1)*16384-ffcount-1]) = $ff) then
inc(ffcount)
else
datalength_boo:=true;
end;
for i:=0 to 16343-ffcount do
Bin[kuer1+i]:=ByteArr[(kuai)*16384+i+40];
kuer1:=kuer1+16344-ffcount;
dsq:='d:/WavFile/'+riqi+shijian+'.bin';
assignfile(f1,dsq);
rewrite(f1,1);
blockwrite(f1,Bin[0],data,targetcount);
closefile(f1);
setlength(Bin,0);
inc(kuai);
kuer:=0;
kuer1:=0;
fkuai:=true;
fenkuai:=true;
aaa:=true;
data:=0;
//exit;
end;
end
else
begin
datalength_boo:=false;
ffcount:=0;
while not datalength_boo do
begin
if ((ByteArr[(kuai+1)*16384-ffcount-1]) = $ff) then
inc(ffcount)
else
datalength_boo:=true;
end;
if (ByteArr[(kuai)*16384+12])= $00 then
begin
time_head_1();
for i:=0 to 16311-ffcount do
Bin[kuer1+i]:=ByteArr[(kuai)*16384+i+72];
kuer1:=kuer1+16312-ffcount;
inc(kuai);
end
else
begin
for i:=0 to 16343-ffcount do
Bin[kuer1+i]:=ByteArr[(kuai)*16384+i+40];
kuer1:=kuer1+16344-ffcount;
inc(kuai);
end;
end;
end;
end;
fenkuai:=true;
end;
end
else
begin
aaa:=false;
ffcount:=0;
datalength:=0;
datalength_boo:=false;
while not datalength_boo do
begin
if ((ByteArr[(kuai+1)*16384-ffcount-1]) = $ff) then
inc(ffcount)
else
datalength_boo:=true
end;
if (ByteArr[kuai*16384+12])=$00 then
datalength:=16312-ffcount
else
datalength:=16344-ffcount;
data:=data+datalength;
inc(kuai);
inc(kuer);
end;
end;
end
else
begin
ffover:=true;
end;
timedelay(5);
if (ffover=false) then zhuan_huan();
end;