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

程式在迴圈中反應延遲,該如何解決?

尚未結案
kan0515
中階會員


發表:56
回覆:120
積分:50
註冊:2002-06-24

發送簡訊給我
#1 引用回覆 回覆 發表時間:2002-08-09 10:52:01 IP:211.23.xxx.xxx 未訂閱
我的程式在執行其他程序及迴路時 按鍵常常無法及時反應 例如利用updown時,值常常會相差1 我已有使用Application.ProcessMessages; 但仍會造成延遲的狀況 請問這該如何解決呢? 謝謝 發表人 - ddy 於 2002/11/28 14:24:28
turboted
版主


發表:95
回覆:754
積分:452
註冊:2002-07-23

發送簡訊給我
#2 引用回覆 回覆 發表時間:2002-08-09 10:56:14 IP:210.71.xxx.xxx 未訂閱
不知道您是否有使用Multi_Thread 試過 而您所說的值差1...指的是什麼值?
kan0515
中階會員


發表:56
回覆:120
積分:50
註冊:2002-06-24

發送簡訊給我
#3 引用回覆 回覆 發表時間:2002-08-09 11:01:16 IP:211.23.xxx.xxx 未訂閱
沒有…sorry, 我對multi-thread不太了解 請問那該如何使用
cmf
尊榮會員


發表:84
回覆:918
積分:1032
註冊:2002-06-26

發送簡訊給我
#4 引用回覆 回覆 發表時間:2002-12-31 12:51:58 IP:61.218.xxx.xxx 未訂閱
引言: 沒有…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

發送簡訊給我
#5 引用回覆 回覆 發表時間:2003-01-23 15:33:11 IP:211.23.xxx.xxx 未訂閱
感謝cmf大大還特別抽空解答此問題
系統時間:2024-04-24 8:48:17
聯絡我們 | Delphi K.Top討論版
本站聲明
1. 本論壇為無營利行為之開放平台,所有文章都是由網友自行張貼,如牽涉到法律糾紛一切與本站無關。
2. 假如網友發表之內容涉及侵權,而損及您的利益,請立即通知版主刪除。
3. 請勿批評中華民國元首及政府或批評各政黨,是藍是綠本站無權干涉,但這裡不是政治性論壇!