線上訂房服務-台灣趴趴狗聯合訂房中心
發文 回覆 瀏覽次數:943
推到 Plurk!
推到 Facebook!

請問一個錯誤訊息

答題得分者是:william
conchih
一般會員


發表:41
回覆:33
積分:14
註冊:2003-06-07

發送簡訊給我
#1 引用回覆 回覆 發表時間:2003-08-22 20:27:44 IP:61.230.xxx.xxx 未訂閱
各位前輩 小弟在使用assignfile讀檔時,程式一執行就出現下面的畫面     請問是什麼問題 小弟使用的系統是xp,不知有否關係     謝謝    
hagar
版主


發表:143
回覆:4056
積分:4445
註冊:2002-04-14

發送簡訊給我
#2 引用回覆 回覆 發表時間:2003-08-23 10:40:29 IP:202.39.xxx.xxx 未訂閱
貼出您出錯的部份, 否則大家也猜不出來! --- 歡迎光臨 ><>@
conchih
一般會員


發表:41
回覆:33
積分:14
註冊:2003-06-07

發送簡訊給我
#3 引用回覆 回覆 發表時間:2003-08-23 18:13:20 IP:61.230.xxx.xxx 未訂閱
我的程式碼如下:(謝謝) 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

發送簡訊給我
#4 引用回覆 回覆 發表時間:2003-08-23 19:49:15 IP:210.3.xxx.xxx 未訂閱
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

發送簡訊給我
#5 引用回覆 回覆 發表時間:2003-08-23 20:23:58 IP:61.230.xxx.xxx 未訂閱
感謝 William 大大的解答
系統時間:2024-05-20 7:42:13
聯絡我們 | Delphi K.Top討論版
本站聲明
1. 本論壇為無營利行為之開放平台,所有文章都是由網友自行張貼,如牽涉到法律糾紛一切與本站無關。
2. 假如網友發表之內容涉及侵權,而損及您的利益,請立即通知版主刪除。
3. 請勿批評中華民國元首及政府或批評各政黨,是藍是綠本站無權干涉,但這裡不是政治性論壇!