forum.vdsworld.com Forum Index forum.vdsworld.com
Visit VDSWORLD.com
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


Two Timer Events Clashing?

 
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> General Help
View previous topic :: View next topic  
Author Message
noveltech
Contributor
Contributor


Joined: 16 Sep 2002
Posts: 105

PostPosted: Wed Nov 26, 2003 4:15 pm    Post subject: Two Timer Events Clashing? Reply with quote

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
Back to top
View user's profile Send private message
Vic D'Elfant
Past Contributor
Past Contributor


Joined: 26 Jun 2002
Posts: 673
Location: The Netherlands

PostPosted: Wed Nov 26, 2003 6:05 pm    Post subject: Reply with quote

Just to remember you: please use the [code:1:d166aad171] tag...
When using it, it is a lot easier for other users to debug your scripts because it highlites the code and they're able to download the whole script Smile

Regards,
Vic

_________________
phpBB Development Team
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> General Help All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum

Twitter@vdsworld       RSS

Powered by phpBB © 2001, 2005 phpBB Group