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

有關TStringList之add的問題...

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


發表:63
回覆:48
積分:22
註冊:2003-02-11

發送簡訊給我
#1 引用回覆 回覆 發表時間:2003-07-25 18:30:54 IP:61.56.xxx.xxx 未訂閱
請教一下,我用TStringList的add這個指令,如果想指定寫入的位置,該怎麼修正我的程式 TStringList *s1=new TStringList; s1->LoadFromFile("A.txt"); s1->Add(Edit2->Text); s1->Add(Edit3->Text); 範例:將 Edit2->Text 與 Edit3->Text 寫到第5筆資料之位置(一對為一筆), X <-- 第一筆 X X <-- 第二筆 X X X X X Edir2->Text Edit3->Text
RaynorPao
版主


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

發送簡訊給我
#2 引用回覆 回覆 發表時間:2003-07-25 19:58:40 IP:61.221.xxx.xxx 未訂閱
引言: 請教一下,我用TStringList的add這個指令,如果想指定寫入的位置,該怎麼修正我的程式 TStringList *s1=new TStringList; s1->LoadFromFile("A.txt"); s1->Add(Edit2->Text); s1->Add(Edit3->Text); 範例:將 Edit2->Text 與 Edit3->Text 寫到第5筆資料之位置(一對為一筆), X <-- 第一筆 X X <-- 第二筆 X X X X X Edir2->Text Edit3->Text
hjlin 你好: TStringList class 不是有一個 Insert 的 method 嗎?? < class="code"> TStringList::Insert Inserts a string to the list at the position specified by Index. virtual void __fastcall Insert(int Index, const AnsiString S); Description Call Insert to add the string S to the list at the position specified by Index. If Index is 0, the string is inserted at the beginning of the list. If Index is 1, the string is put in the second position of the list, and so on. If the string has an associated object, use the InsertObject method instead. Note: If the list is sorted, calling Insert or InsertObject will throw an EListError exception. Use Add or AddObject with sorted lists. 備註: 建議你先查詢 BCB Help 中的說明,自己練習寫寫看,如果真的不會寫或寫不出 來的話,再告訴小弟我吧< >;畢竟這樣一直問下去也不是辦法,最好能夠培養 自己解決問題的能力< > -- Enjoy Researching & Developing --
------
-- 若您已經得到滿意的答覆,請適時結案!! --
-- 欲知前世因,今生受者是;欲知來世果,今生做者是 --
-- 一切有為法,如夢幻泡影,如露亦如電,應作如是觀 --
hjlin
一般會員


發表:63
回覆:48
積分:22
註冊:2003-02-11

發送簡訊給我
#3 引用回覆 回覆 發表時間:2003-07-25 22:10:07 IP:218.168.xxx.xxx 未訂閱
引言:
引言: 請教一下,我用TStringList的add這個指令,如果想指定寫入的位置,該怎麼修正我的程式 TStringList *s1=new TStringList; s1->LoadFromFile("A.txt"); s1->Add(Edit2->Text); s1->Add(Edit3->Text); 範例:將 Edit2->Text 與 Edit3->Text 寫到第5筆資料之位置(一對為一筆), X <-- 第一筆 X X <-- 第二筆 X X X X X Edir2->Text Edit3->Text
hjlin 你好: TStringList class 不是有一個 Insert 的 method 嗎?? < class="code"> TStringList::Insert Inserts a string to the list at the position specified by Index. virtual void __fastcall Insert(int Index, const AnsiString S); Description Call Insert to add the string S to the list at the position specified by Index. If Index is 0, the string is inserted at the beginning of the list. If Index is 1, the string is put in the second position of the list, and so on. If the string has an associated object, use the InsertObject method instead. Note: If the list is sorted, calling Insert or InsertObject will throw an EListError exception. Use Add or AddObject with sorted lists. 備註: 建議你先查詢 BCB Help 中的說明,自己練習寫寫看,如果真的不會寫或寫不出 來的話,再告訴小弟我吧< >;畢竟這樣一直問下去也不是辦法,最好能夠培養 自己解決問題的能力< > -- Enjoy Researching & Developing --
包子: 不好意思,我真不知道要如何查說是否有Insert這個指令啊~ 可否教我要如何利用 BCB Help 來查自己想要知道的指令放在哪邊?謝謝! 我一直都不知道要如何查詢說?這對我來說很重要~謝謝!
RaynorPao
版主


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

發送簡訊給我
#4 引用回覆 回覆 發表時間:2003-07-25 22:24:22 IP:61.221.xxx.xxx 未訂閱
引言: 包子: 不好意思,我真不知道要如何查說是否有Insert這個指令啊~ 可否教我要如何利用 BCB Help 來查自己想要知道的指令放在哪邊?謝謝! 我一直都不知道要如何查詢說?這對我來說很重要~謝謝!
hjlin 你好:
(1)在 BCB 開發環境中按「Help/C   Builder Help」出現「Borland C   
   Builder Help」Dialog
(2)按「說明主題」出現「說明主題: Borland C   Builder Help」Dialog
(3)在「輸入你要找的文字」欄位中鍵入你要搜尋的關鍵字(例如: TStringList)
(4)然後按「Enter」就會出現該 class 的相關說明 (例如: Hierarchy,
   Properties, Methods, Events....)
(5)你可以依照此種方式查到 class 的詳細文件內容,有些 Properties,
   Methods, Events 的說明文件裡面,還有附範例程式碼喔
(6)加油,如果還有問題再告訴小弟我
    -- 
        
------
-- 若您已經得到滿意的答覆,請適時結案!! --
-- 欲知前世因,今生受者是;欲知來世果,今生做者是 --
-- 一切有為法,如夢幻泡影,如露亦如電,應作如是觀 --
axsoft
版主


發表:681
回覆:1056
積分:969
註冊:2002-03-13

發送簡訊給我
#5 引用回覆 回覆 發表時間:2003-07-25 22:34:36 IP:218.173.xxx.xxx 未訂閱
引言: 包子: 不好意思,我真不知道要如何查說是否有Insert這個指令啊~ 可否教我要如何利用 BCB Help 來查自己想要知道的指令放在哪邊?謝謝! 我一直都不知道要如何查詢說?這對我來說很重要~謝謝!
hjlin您好: 圖1. 在上圖中鍵入->等待一會會出現您要的提示語法,然後選擇您需要的就可以了! 如果要查尋Inster只要把Inster文字用滑鼠Marker起來然後按F1就會出現下圖了! 圖2. 用滑鼠選擇您要查的函式語法就行了!試試看! HAVE A NICE DAY FOR YOU
系統時間:2024-05-18 7:23:57
聯絡我們 | Delphi K.Top討論版
本站聲明
1. 本論壇為無營利行為之開放平台,所有文章都是由網友自行張貼,如牽涉到法律糾紛一切與本站無關。
2. 假如網友發表之內容涉及侵權,而損及您的利益,請立即通知版主刪除。
3. 請勿批評中華民國元首及政府或批評各政黨,是藍是綠本站無權干涉,但這裡不是政治性論壇!