I have a countdown timer on field "TIMER_fld" the format is 00:00 (minute:secon)
it will start/pause with button "Start"
and i want update the timer with button option menu "SECON_update"
here are the code:
"TIMER_field"
Code: Select all
on textchanged
end textchanged
Code: Select all
on mouseUp
If the label of ME is "Start" then
set the label of ME to "Stop"
set the backgroundcolor of ME to green
else
set the label ME to "Start"
set the backgroundcolor of ME to empty
end if
DoCountDown field TIMER_fld
end mouseUp
on DoCountDown pTime
if label of button "Start" is "Start"
else
convert pTime to seconds
subtract 1 from pTime
convert pTime to dateItems
split pTime by ","
put format("%02d:%02d",pTime[4],pTime[5],pTime[6]) into tNewTime
put tNewTime into fld "TIMER_fld"
//CASPAR
put "CG 1-2 UPDATE 1 " into tm1xml
put quote after tm1xml
put "<templateData><componentData id=\" after tm1xml
put quote after tm1xml
put "f3\" after tm1xml
put quote after tm1xml
put "><data id=\" after tm1xml
put quote after tm1xml
put "text\" after tm1xml
put quote after tm1xml
put " value=\" after tm1xml
put quote after tm1xml
put tNewTime after tm1xml
put "\" after tm1xml
put quote after tm1xml
put " /></componentData></templateData>" after tm1xml
put quote after tm1xml
put field ipport1 of card 003 after server1
write tm1xml & format("\r\n") to socket server1
if tNewTime = "00:00" then do TimesUp
else
send "DoCountDown tNewTime" to me in 1 second
end if
end if
end DoCountDown
on TimesUp
put "CG 1-2 UPDATE 1 " into tm1xml
put quote after tm1xml
put "<templateData><componentData id=\" after tm1xml
put quote after tm1xml
put "f3\" after tm1xml
put quote after tm1xml
put "><data id=\" after tm1xml
put quote after tm1xml
put "text\" after tm1xml
put quote after tm1xml
put " value=\" after tm1xml
put quote after tm1xml
put field TIMER_fld after tm1xml
put "\" after tm1xml
put quote after tm1xml
put " /></componentData></templateData>" after tm1xml
put quote after tm1xml
put field ipport1 of card 003 after server
write tm1xml & format("\r\n") to socket server
end TimesUp
on TimesStopped
end TimesStopped
option menu "SECON_update"
Code: Select all
on mouseUp
put the label name of me into char 4 to 5 of word 1 of line 1 of field "TIMER_fld"
end mouseUp
-Stop and start button also running
-Update button Work when timer pause
-But It Won't work UPDATE when timer on
? What I want is ... I can UDATE Timer on the fly when the Timer countdown.
Anybody Know What wrong with my code?
Any comment and help Would be Apriciate ...
Thanx