請問一個錯誤訊息 |
答題得分者是:william
|
conchih
一般會員 發表:41 回覆:33 積分:14 註冊:2003-06-07 發送簡訊給我 |
|
hagar
版主 發表:143 回覆:4056 積分:4445 註冊:2002-04-14 發送簡訊給我 |
|
conchih
一般會員 發表:41 回覆:33 積分:14 註冊:2003-06-07 發送簡訊給我 |
我的程式碼如下:(謝謝)
procedure TForm1.Button1Click(Sender: TObject);
Var
F1:File;
Filename,StringTemp:String;
OneByte:Byte;
i:integer;
Begin
Filename:='E:\6232.dat';
AssignFile(F1,FILENAME);
Reset(F1);
StringTemp:='';
for i:=1 to 10 do
begin
Blockread(F1,OneByte,SizeOf(OneByte));
StringTemp:=StringTemp IntToStr(OneByte) ' ';
if (i mod 8=0) then
StringTemp:=Stringtemp #10;
end;
Showmessage(StringTemp);
CloseFile(F1);
end; end.
|
william
版主 發表:66 回覆:2535 積分:3048 註冊:2002-07-11 發送簡訊給我 |
F1:File of byte; BTW you should check how many byte has been read... and EOF... Quoted from Delphi help: Untyped files are low-level I/O channels used primarily for direct access to disk files regardless of type and structuring. An untyped file is declared with the word file and nothing more. For example, var DataFile: file; For untyped files, the Reset and Rewrite procedures allow an extra parameter to specify the record size used in data transfers. For historical reasons, the default record size is 128 bytes. A record size of 1 is the only value that correctly reflects the exact size of any file. (No partial records are possible when the record size is 1.) Except for Read and Write, all typed-file standard procedures and functions are also allowed on untyped files. Instead of Read and Write, two procedures called BlockRead and BlockWrite are used for high-speed data transfers.
|
conchih
一般會員 發表:41 回覆:33 積分:14 註冊:2003-06-07 發送簡訊給我 |
本站聲明 |
1. 本論壇為無營利行為之開放平台,所有文章都是由網友自行張貼,如牽涉到法律糾紛一切與本站無關。 2. 假如網友發表之內容涉及侵權,而損及您的利益,請立即通知版主刪除。 3. 請勿批評中華民國元首及政府或批評各政黨,是藍是綠本站無權干涉,但這裡不是政治性論壇! |