Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

help !! delphi

0 views
Skip to first unread message

Bug Bug

unread,
Jan 18, 1997, 3:00:00 AM1/18/97
to

請教一下,為什麼我下面這段程式會產生
Division by zero 的錯誤 ??

procedure Tmain.Open1Click(Sender: TObject);
var rfn: file;
code : array[1..11] of char;
begin
if openDialog1.execute then
begin assignfile( rfn, openDialog1.FileName );
reset( rfn ) ;

blockread( rfn, code ,1);<----------------就是這行產生錯誤的!!
if ansicomparestr(code,'this is jak')<>0
then begin
showmessage(' 這不是 FX2 的檔案 ');
closefile(rfn);
exit;
end;

blockread( rfn, sketch_height, 1 );
blockread( rfn, sketch_width, 1 );

closefile(rfn);
end;
end;

procedure Tmain.Save1Click(Sender: TObject);
var sfn: file;
const code: array[1..11] of char='this is jak';
begin
if SaveDialog1.execute then
begin
assignfile( sfn, SaveDialog1.FileName );

rewrite( sfn );
blockwrite( sfn, code, 1 );
blockwrite( sfn, sketch_height, 1 );
blockwrite( sfn, sketch_width, 1 );

closefile(sfn);
end;
end;
知道的話請告訢我好嗎, 謝謝!!
--
* Origin: 南開工商專 PowerBBS 站 <b...@bbs.nkjc.edu.tw>


0 new messages