線上訂房服務-台灣趴趴狗聯合訂房中心
發文 回覆 瀏覽次數:1365
推到 Plurk!
推到 Facebook!

執行print port i/o程式時,label沒辦法顯示.

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


發表:6
回覆:13
積分:3
註冊:2003-11-11

發送簡訊給我
#1 引用回覆 回覆 發表時間:2004-06-21 16:48:27 IP:210.243.xxx.xxx 未訂閱
Hi 各位大大,     我寫了一個以print port輸出的程式,但是非得程式完全執行完label才會顯示,而且整個程式好像當掉一樣,我是用io.dll,這個library,附圖中央空白部分即是要顯示的label,下面是我的程式,煩請看一下幫幫我,謝謝. void __fastcall TForm1::Button1Click(TObject *Sender) {  int a,charge,strobe,time,k;  long j; k=1; Edit2->Text=0; time=StrToInt(Edit1->Text); Edit2->Text=0;    for (i=0;iCaption=" "; } charge=1; strobe=1; a=0; for (j=0;jCaption="Charge"; //<---LABEL 顯示 } PortWordOut(PtrAddress,a); //cut charge charge=1; PortWordOut(PtrAddress,charge); Sleep(8000); PortWordOut(PtrAddress,0); Sleep(2000); Label1->Caption="Complete"; //<---LABEL 顯示 PortWordOut(PtrAddress,4); Sleep(200); PortWordOut(PtrAddress,0); for (j=0;jText=IntToStr(i+1); } }
RaynorPao
版主


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

發送簡訊給我
#2 引用回覆 回覆 發表時間:2004-06-21 16:59:45 IP:203.73.xxx.xxx 未訂閱
引言: Hi 各位大大, 我寫了一個以print port輸出的程式,但是非得程式完全執行完label才會顯示,而且整個程式好像當掉一樣,我是用io.dll,這個library,附圖中央空白部分即是要顯示的label,下面是我的程式,煩請看一下幫幫我,謝謝.
void __fastcall TForm1::Button1Click(TObject *Sender)
{
 int a,charge,strobe,time,k;
 long j;
k=1;
Edit2->Text=0;
time=StrToInt(Edit1->Text);
Edit2->Text=0;    for (i=0;iCaption=" ";
  }
  charge=1;
  strobe=1;
  a=0;
 for (j=0;jCaption="Charge"; //<---LABEL 顯示
  }
  
  PortWordOut(PtrAddress,a); //cut charge       charge=1;
   PortWordOut(PtrAddress,charge);        Sleep(8000);
   PortWordOut(PtrAddress,0);        Sleep(2000);
   Label1->Caption="Complete"; //<---LABEL 顯示
   PortWordOut(PtrAddress,4); 
   Sleep(200);       PortWordOut(PtrAddress,0); 
  for (j=0;jText=IntToStr(i+1);
   }
  }
lcu 你好:
(1)先試試在你程式碼 for 迴圈裡面加入以下這一行程式碼 (或者加在要改變
   Label 的 Caption 那行程式碼之後)
   > >

< class="code">
其他相關文章:
http://delphi.ktop.com.tw/topic.php?topic_id=46827
http://delphi.ktop.com.tw/topic.php?topic_id=27008
-- Enjoy Researching & Developing -- 發表人 - RaynorPao 於 2004/06/21 17:19:27
------
-- 若您已經得到滿意的答覆,請適時結案!! --
-- 欲知前世因,今生受者是;欲知來世果,今生做者是 --
-- 一切有為法,如夢幻泡影,如露亦如電,應作如是觀 --
lcu
一般會員


發表:6
回覆:13
積分:3
註冊:2003-11-11

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