全國最多中醫師線上諮詢網站-台灣中醫網
發文 回覆 瀏覽次數:1111
推到 Plurk!
推到 Facebook!

stringgrid怎�牏~能�F示出�X容?

尚未結案
WWW999
一般會員


發表:18
回覆:19
積分:7
註冊:2005-09-26

發送簡訊給我
#1 引用回覆 回覆 發表時間:2005-09-27 10:38:53 IP:222.160.xxx.xxx 未訂閱
stringgrid怎樣才能顯示出內容?    有一個son.rec記錄文件,我想讀出它中間的內容,它沒有文件頭。始終也讀不出來?請幫幫我,多謝指教!!! 代?: unit Unit1; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, Grids, StdCtrls, Buttons; Type SconRecFile=Record RecType:Integer; //此項記錄的類型(0計時 1限時 2會員 3通宵) RecDate:TDateTime; //此項記錄的日期 BeginTime:TDateTime; //上机開始時間 EndTime:TDateTime; //上机結束時間 RecMinTime:Integer; //上机總用時(以分鐘為單位) ComputerNum:Integer; //此机机號 Price:Real; //費率 Money1:Real; //上机費用 負值代表費用轉移了 Money2:Real; //附加費用 負值代表費用轉移了 Money3:Real; //實收金額 負值代表費用轉移了 Manager:String[16]; //管理者名字 Username:String[16]; //使用者名字 Memo:String[100]; //備注 End; type TForm1 = class(TForm) BitBtn1: TBitBtn; BitBtn2: TBitBtn; BitBtn3: TBitBtn; StringGrid1: TStringGrid; OpenDialog1: TOpenDialog; procedure BitBtn1Click(Sender: TObject); procedure BitBtn3Click(Sender: TObject); private { Private declarations } public { Public declarations } end; var Form1: TForm1; implementation {$R *.dfm} procedure TForm1.BitBtn1Click(Sender: TObject); var userpost1:SconRecFile; userpostfile:file of SconRecFile; userpostpathname:string; begin assignfile(userpostfile,userpostpathname); if OpenDialog1.Execute then Reset(userpostfile) With stringgrid1 do stringgrid1.cells[0,0] := ''; stringgrid1.cells[1,0] := '此机机號 '; stringgrid1.cells[2,0] := '記錄的日期'; stringgrid1.cells[3,0] := '開始時間'; stringgrid1.cells[4,0] := '結束時間'; stringgrid1.cells[5,0] := '上机總用時'; stringgrid1.cells[6,0] := '費率'; stringgrid1.cells[7,0] := '上机費用'; stringgrid1.cells[8,0] := '附加費用'; stringgrid1.cells[9,0] := '實收金額 '; stringgrid1.cells[10,0] := '計時'; stringgrid1.cells[11,0] := '限時'; stringgrid1.cells[12,0] := '會員'; stringgrid1.cells[13,0] := '通宵'; stringgrid1.cells[14,0] := '管理者名字'; stringgrid1.cells[15,0] := '使用者名字'; stringgrid1.cells[16,0] := '備注'; end; procedure TForm1.BitBtn3Click(Sender: TObject); begin closeFile; end; end. 我剛學delhpi 錯在哪里?請多多指教,多謝
william
版主


發表:66
回覆:2535
積分:3048
註冊:2002-07-11

發送簡訊給我
#2 引用回覆 回覆 發表時間:2005-09-27 10:58:55 IP:147.8.xxx.xxx 未訂閱
1. There is no actual read from file operation. 2. I guess you would like to use packed record instead of record. http://pywong.hk.st http://www.lazybones.ca
WWW999
一般會員


發表:18
回覆:19
積分:7
註冊:2005-09-26

發送簡訊給我
#3 引用回覆 回覆 發表時間:2005-09-27 12:04:23 IP:222.160.xxx.xxx 未訂閱
1. There is no actual read from file operation. 2. I guess you would like to use packed record instead of record. -------------------------------------------------------------------------------- http://pywong.hk.st http://www.lazybones.ca 多謝 您的回答,但沒能解決我的問題! 我的問題是如何才能讀出scon.rec中的記錄,它是用delphi編寫的。將它的內容顯示到StringGrid里。我找過好多网站,代碼也看了不少,但就是讀不出來,我想知道代碼哪寫的不對?如何寫?好在以后的編輯中去應用它。
系統時間:2024-05-19 12:28:45
聯絡我們 | Delphi K.Top討論版
本站聲明
1. 本論壇為無營利行為之開放平台,所有文章都是由網友自行張貼,如牽涉到法律糾紛一切與本站無關。
2. 假如網友發表之內容涉及侵權,而損及您的利益,請立即通知版主刪除。
3. 請勿批評中華民國元首及政府或批評各政黨,是藍是綠本站無權干涉,但這裡不是政治性論壇!