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

找出index/pos位置

答題得分者是:yachanga
BorlandUser
中階會員


發表:148
回覆:217
積分:73
註冊:2004-02-19

發送簡訊給我
#1 引用回覆 回覆 發表時間:2004-04-14 09:49:24 IP:203.185.xxx.xxx 未訂閱
係一條string裏面,找出index/pos位置 咩function可以做到?
yachanga
資深會員


發表:24
回覆:335
積分:296
註冊:2003-09-27

發送簡訊給我
#2 引用回覆 回覆 發表時間:2004-04-14 10:27:52 IP:211.74.xxx.xxx 未訂閱
POS(substr,String)    Ex: showmessage(inttoStr(pos('E','TEST')));// 傳回2 ~悠遊法國號~ 發表人 - yachanga 於 2004/04/14 10:34:14
BorlandUser
中階會員


發表:148
回覆:217
積分:73
註冊:2004-02-19

發送簡訊給我
#3 引用回覆 回覆 發表時間:2004-04-14 10:47:08 IP:203.185.xxx.xxx 未訂閱
Thank you very much, 但有冇得check一條string係咪alpha/numeric呢?
BorlandUser
中階會員


發表:148
回覆:217
積分:73
註冊:2004-02-19

發送簡訊給我
#4 引用回覆 回覆 發表時間:2004-04-14 10:50:14 IP:203.185.xxx.xxx 未訂閱
係咪仲可以check到一條string裏面有冇存在這些符號"?\]';"等等
yachanga
資深會員


發表:24
回覆:335
積分:296
註冊:2003-09-27

發送簡訊給我
#5 引用回覆 回覆 發表時間:2004-04-14 13:07:47 IP:211.74.xxx.xxx 未訂閱
都可以啊 可以自己試試    showmessage(inttoStr(pos('?','Test?12/]')));// 傳回5    ~悠遊法國號~
BorlandUser
中階會員


發表:148
回覆:217
積分:73
註冊:2004-02-19

發送簡訊給我
#6 引用回覆 回覆 發表時間:2004-04-14 14:29:38 IP:203.185.xxx.xxx 未訂閱
Thank you, 請容許我問多少少,如果要將一個string的某些字換成某一字,應該用那些function,因為我看過書本,好像有好幾過都可以用,不知那個最好?
BorlandUser
中階會員


發表:148
回覆:217
積分:73
註冊:2004-02-19

發送簡訊給我
#7 引用回覆 回覆 發表時間:2004-04-14 15:01:42 IP:203.185.xxx.xxx 未訂閱
因為不想開新topic,請原諒,我想問fee和release有咩分別架?
yachanga
資深會員


發表:24
回覆:335
積分:296
註冊:2003-09-27

發送簡訊給我
#8 引用回覆 回覆 發表時間:2004-04-15 17:52:09 IP:211.74.xxx.xxx 未訂閱
引言: 因為不想開新topic,請原諒,我想問fee和release有咩分別架?
您是想問free 和 release 有何不同嗎? 小弟也不是挺清楚, 提供資料給您參考 (1) Release (Delphi Help TCustomForm.Release)
procedure TCustomForm.Release;
begin
  PostMessage(Handle, CM_RELEASE, 0, 0);
end;
Destroys the form and frees its associated memory. Use Release to destroy the form and free its associated memory. Release does not destroy the form until all event handlers of the form and event handlers of components on the form have finished executing. Release also guarantees that all messages in the form's event queue are processed before the form is released. Any event handlers of the form should use Release instead of Free. Failing to do so could lead to an access violation. (2) Free (Delphi Help TObject.Free)
destructor TObject.Destroy;
begin
end;    procedure TObject.Free;
begin
  if Self <> nil then
    Destroy;
end;
Destroys an object and frees its associated memory, if necessary. Use Free to destroy an object. Free automatically calls the destructor if the object reference is not nil. Any object instantiated at runtime that does not have an owner should be destroyed by a call to Free so that it can be properly disposed of and its memory released. Unlike Destroy, Free is successful even if the object is nil; so if the object was never initialized, Free won急 result in an error. When you call Free for a component, it calls Free for all components that it owns? hat is, all components in its component list. Since a form owns all the controls and nonvisual components that are created on it in design mode, those components are automatically freed when the form is freed. By default, ll forms are owned by the Application object; when the application terminates, it frees the Application object, which frees all forms. For objects that are not components, or for components created with a nil owner, be sure to call Free after you are finished with them; otherwise the allocated memory will not be usable until after the application terminates. To free a form, call its Release method, which destroys the form and releases the memory allocated for it after all its event handlers and those of the components it contains are through executing. ~悠遊法國號~
系統時間:2024-06-02 0:55:16
聯絡我們 | Delphi K.Top討論版
本站聲明
1. 本論壇為無營利行為之開放平台,所有文章都是由網友自行張貼,如牽涉到法律糾紛一切與本站無關。
2. 假如網友發表之內容涉及侵權,而損及您的利益,請立即通知版主刪除。
3. 請勿批評中華民國元首及政府或批評各政黨,是藍是綠本站無權干涉,但這裡不是政治性論壇!