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

請教讀檔的程式碼

答題得分者是:RaynorPao
glenn
一般會員


發表:24
回覆:21
積分:9
註冊:2004-03-08

發送簡訊給我
#1 引用回覆 回覆 發表時間:2004-05-28 10:40:16 IP:218.170.xxx.xxx 未訂閱
下面是一個讀檔用的程式碼:     TStringList *S1=new TStringList;     TStringList *S2=new TStringList;     S1->LoadFromFile("1.txt");      //動態宣告二維陣列          a=new int*[N];       for(int x=0;xCount;i ) { AnsiString S; S=S1->Strings[i]; S=StringReplace(S,"",",",TReplaceFlags()<CommaText=S; for(int j=0;jCount;j ) { a[i][j]=StrToInt(S2->Strings[j]); } } delete S2; delete S1; 可是 S=StringReplace(S,"",",",TReplaceFlags()<
RaynorPao
版主


發表:139
回覆:3622
積分:7025
註冊:2002-08-12

發送簡訊給我
#2 引用回覆 回覆 發表時間:2004-05-28 10:53:00 IP:203.73.xxx.xxx 未訂閱
引言: 下面是一個讀檔用的程式碼: TStringList *S1=new TStringList; TStringList *S2=new TStringList; S1->LoadFromFile("1.txt"); //動態宣告二維陣列 a=new int*[N]; for(int x=0;xCount;i++) { AnsiString S; S=S1->Strings[i]; S=StringReplace(S,"",",",TReplaceFlags()<CommaText=S; for(int j=0;jCount;j++) { a[i][j]=StrToInt(S2->Strings[j]); } } delete S2; delete S1; 可是 S=StringReplace(S,"",",",TReplaceFlags()< glenn 你好: 請參考以下的連結文章 src="http://delphi.ktop.com.tw/loadfile.php?TOPICID=10003806&CC=223734"> -- Enjoy Researching & Developing --
------
-- 若您已經得到滿意的答覆,請適時結案!! --
-- 欲知前世因,今生受者是;欲知來世果,今生做者是 --
-- 一切有為法,如夢幻泡影,如露亦如電,應作如是觀 --
bigdogchina
版主


發表:238
回覆:523
積分:312
註冊:2003-04-28

發送簡訊給我
#3 引用回覆 回覆 發表時間:2004-05-28 10:53:47 IP:211.162.xxx.xxx 未訂閱
插個花,看看Help,StringReplace的解釋: StringReplace Returns an AnsiString with occurrences of one substring replaced by another substring. Description StringReplace replaces occurrences of the substring specified by OldPattern with the substring specified by NewPattern. StringReplace assumes that the source string, specified by S, may contain Multibyte characters. If the Flags parameter does not include rfReplaceAll, StringReplace only replaces the first occurrence of OldPattern in S. Otherwise, all instances of OldPattern are replaced by NewPattern. If the Flags parameter includes rfIgnoreCase, The comparison operation is case insensitive.

===============
人生在勤,不索何获? 
===============
------
人生在勤,不索何获?
glenn
一般會員


發表:24
回覆:21
積分:9
註冊:2004-03-08

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