T
txyx
Unregistered / Unconfirmed
GUEST, unregistred user!
我找到了出错的原因了,readln在遇到回车符就停下来了,可是我想一次读出256个字节来,还能用readln吗?
我的程序:
if opendialog1.execute
then
begin
AssignFile(f,opendialog1.FileName);
Reset(f);
size:=filesize(f);
Readln(f,s);
for i:=1 to length(s) do
begin
Appendstr(tem,InttoHex(ord(s),2)+#20);
if i mod 4 = 0 then AppendStr(tem,' ');
if i mod 16=0 then AppendStr(tem,#13#10);
if i mod 256=0 then AppendStr(tem,#13#10);
end;
richedit1.Lines.Text :=tem;
closeFile(f);
我的程序:
if opendialog1.execute
then
begin
AssignFile(f,opendialog1.FileName);
Reset(f);
size:=filesize(f);
Readln(f,s);
for i:=1 to length(s) do
begin
Appendstr(tem,InttoHex(ord(s),2)+#20);
if i mod 4 = 0 then AppendStr(tem,' ');
if i mod 16=0 then AppendStr(tem,#13#10);
if i mod 256=0 then AppendStr(tem,#13#10);
end;
richedit1.Lines.Text :=tem;
closeFile(f);