noveltech Contributor

Joined: 16 Sep 2002 Posts: 105
|
Posted: Wed Nov 26, 2003 4:15 pm Post subject: Two Timer Events Clashing? |
|
|
The below example from VDS5 DEMOs. Has been modified.
Seeking insight and understanding. Yoda not avail.
The second dialog time event clashing with first dialog? but why?
Thank you for insight if possible, nt.
| Code: |
OPTION TIMESEP,:
DIALOG CREATE,Timers,-1,0,200,198
DIALOG ADD,GROUP,GROUP2,2,15,170,170,Countdown
DIALOG ADD,BUTTON,BTN_CTDOWN,90,50,40,20,On
DIALOG ADD,BUTTON,SUSP_CTDOWN,90,110,40,20,Pause
DIALOG ADD,EDIT,info_CTDOWN,115,64,80,20
DIALOG ADD,SPIN,CTDOWNhour,60,30,40,22,COMBO2
DIALOG ADD,SPIN,CTDOWNminutes,60,80,40,22,COMBO3
DIALOG ADD,SPIN,CTDOWNseconds,60,130,40,22,COMBO4
DIALOG ADD,TEXT,TEXT3,120,20,40,15,Current:
DIALOG ADD,TEXT,TEXT4,145,20,40,15,Active:
DIALOG ADD,EDIT,CTDOWNstatus,140,64,80,20
DIALOG ADD,SPIN,CTDOWNdays,35,30,40,22
DIALOG ADD,TEXT,TEXT5,40,80,35,15,days
DIALOG ADD,STATUS,ST
DIALOG SHOW
:loop
wait event,0
%E = @event()
goto %E
:close
STOP
:Timer
If %%alarm
Dialog set,info_alarme,@timer(1,V)
End
If %%Countdown
Dialog set,info_ctdown,@timer(2,V)
End
If %%chrono
Dialog set,info_chrono,@timer(3,V)
End
Goto loop
REM COUNTDOWN TIMER ROUTINE
:BTN_CTDOWNbutton
dialog set,SUSP_CTDOWN,@chr(34)
if %%Countdown
%%Countdown =
timer stop,2
dialog set,BTN_CTDOWN,On
else
%A = @dlgtext(CTDOWNdays)-@dlgtext(CTDOWNhour):@dlgtext(CTDOWNminutes):@dlgtext(CTDOWNseconds)
timer start,2,Ctdown,%A
dialog set,BTN_CTDOWN,Off
%%Countdown = 1
end
%T = 2
%%Which = CTDOWNStatus
goto infos_timer
:SUSP_CTDOWNbutton
if %%Countdown
%%Countdown =
timer pause,2,ON
dialog set,SUSP_CTDOWN,>
else
timer pause,2,OFF
dialog set,SUSP_CTDOWN,@chr(34)
%%Countdown = 1
end
%T = 2
%%Which = CTDOWNStatus
goto infos_timer
:Timer2CTDown
BEEP
REM the below gosub line added. Rem it out, there is no
REM problem for first dialog
gosub Dialog
Dialog set,st,The countdown @timer(2,I) is over!
%%Countdown =
timer stop,2
dialog set,BTN_CTDOWN,On
dialog set,SUSP_CTDOWN,@chr(34)
%T = 2
%%Which = CTDOWNStatus
goto infos_timer
:infos_timer
%%Status = @timer(%T,S)
If @equal(%%Status,0)
%%Status = STOPPED
Elsif @equal(%%Status,1)
%%Status = RUNNING
Else
rem @timer(%T,S) = 2
%%Status = PAUSED
End
Dialog set,%%Which,%%Status
goto loop
REM PROBLEMS BEGIN WITH SECOND TIME EVENT
REM Begin New Timer Event
:Dialog
title Time Box Two
option ErrorTrap,ErrorBranch3
option Scale,96
%%programname = Time2
DIALOG CREATE,One,-1,0,250,85,NOMIN,ONTOP,,CLASS Timetwo
DIALOG ADD,BITMAP,BITMAP1,0,0,250,85,,,,
DIALOG SHOW
:EVENTLOOP1
wait event, 2
EXIT
|
|
|