程式在迴圈中反應延遲,該如何解決? |
尚未結案
|
kan0515
中階會員 發表:56 回覆:120 積分:50 註冊:2002-06-24 發送簡訊給我 |
|
turboted
版主 發表:95 回覆:754 積分:452 註冊:2002-07-23 發送簡訊給我 |
|
kan0515
中階會員 發表:56 回覆:120 積分:50 註冊:2002-06-24 發送簡訊給我 |
|
cmf
尊榮會員 發表:84 回覆:918 積分:1032 註冊:2002-06-26 發送簡訊給我 |
引言: 沒有…sorry, 我對multi-thread不太了解 請問那該如何使用建立 Thread 如下 1 MainMenu->NEW->Other 2 在 NEW Page 中 選擇 Thread Object 3 輸入 New Class Name (例: TEST) 4 開始撰寫 程序 unit Unit2; interface uses Classes; type test = class(TThread) private { Private declarations } protected procedure Execute; override; end; implementation { Important: Methods and properties of objects in VCL or CLX can only be used in a method called using Synchronize, for example, Synchronize(UpdateCaption); and UpdateCaption could look like, procedure test.UpdateCaption; begin Form1.Caption := 'Updated in a thread'; end; } { test } procedure test.Execute; begin { Place thread code here } // 在這裡 寫入 你的 程序及迴路 end; 5 在你的主程式加入 var SecondProcess:test; { test is a custom descendant of TThread } begin SecondProcess:=Test.Create(True); { create suspended ?secondprocess does not run yet } SecondProcess.Priority := tpLower; { set the priority to lower than normal } SecondProcess.Resume; { now run the thread } end; 現在你可以試看看 bye! bye!
------
︿︿ |
kan0515
中階會員 發表:56 回覆:120 積分:50 註冊:2002-06-24 發送簡訊給我 |
本站聲明 |
1. 本論壇為無營利行為之開放平台,所有文章都是由網友自行張貼,如牽涉到法律糾紛一切與本站無關。 2. 假如網友發表之內容涉及侵權,而損及您的利益,請立即通知版主刪除。 3. 請勿批評中華民國元首及政府或批評各政黨,是藍是綠本站無權干涉,但這裡不是政治性論壇! |