Serge Professional Member


Joined: 04 Mar 2002 Posts: 1480 Location: Australia
|
Posted: Mon Jan 05, 2004 11:45 pm Post subject: Timer problem |
|
|
hi all,
i'm having problems trying to get the following script to run reliably...and i do mean reliably
1. it runs properly when it feels like it...can someone confirm this for me...you need to click on the run button several times before the script will run properly...the problem seems to be with the TIMER command that does its thing only when it wants to...sometimes i need to click on run 5 times before the script runs properly
2. also, if you rem the STOP line, when the timer reaches zero...the TIMER1CTDOWN event is not called but the timer goes into negative countdown...hence the big work around in :TIMER
can someone please confirm these 2 things and suggest what is going on...this is part of a script for the vds competition
thanks in advance
here is the script
| Code: | %%title_bar = jiwejnlwoij
%%dialog_colour = teal
rem === this code below is only what i need ===
Title %%title_bar
DIALOG CREATE,%%title_bar,-1,0,265,320,NOSYS
rem click,color %%dialog_colour
REM *** Modified by Dialog Designer on 6/01/04 - 00:16 ***
DIALOG ADD,STYLE,STYLE2,Verdana,8,C,,
DIALOG ADD,STYLE,STYLE1,Verdana,8,,,
DIALOG ADD,TABLE,TABLE2,5,5,255,295,Name[100C]|.[0C]|.[0C]|Time[150C],,STYLE1
DIALOG ADD,PROGRESS,PROGRESS1,305,8,250,10,0,,SMOOTH
dialog show
%%dummy = @sendmsg(@winexists(~table2),@sum($1000,54),0,$1)
list add, table2, Serge
list add, table2, Timer
%%time_interval = 10
timer start,1,ctdown,@datetime(dd)-00:00:10
:timer
list seek, table2, 0
list put, table2, Serge@tab()@tab()@tab()@datetime(hh:nn:ss)
list seek, table2, 1
list put, table2, Timer@tab()@tab()@tab()@timer(1,v)
%%timer = @timer(1,v)
%%length = @len(%%timer)
%%minutes = @substr(%%timer,@fsub(%%length,5),@fsub(%%length,5))
%%seconds = @substr(%%timer,@fsub(%%length,3),@fsub(%%length,2))
%%total_time = @fadd(@fmul(%%minutes,60),%%seconds)
%%time_frac = @format(@fmul(@fdiv(%%total_time,%%time_interval),100),2.0)
dialog set, progress1, %%time_frac
if @equal(%%time_frac,0)
stop
end
:event
wait event, 0.1
goto @event()
:timer1ctdown
warn worked!
stop
|
serge _________________
|
|