Source language: Translate to:

Timer not updating the elapsed time

General questions about NeoBook

Moderator: Neosoft Support

Timer not updating the elapsed time

Postby DaveJ » Wed Jan 14, 2015 3:51 am

Not sure if this has been covered but when I try to read the variable of the elapsed time on a timer, it always shows '0' as the time as in it doesn't seem to update.
Am I doing something wrong?

Thanks

Dave J
DaveJ
 
Posts: 90
Joined: Tue Dec 30, 2008 11:06 am

Re: Timer not updating the elapsed time

Postby dpayer » Wed Jan 14, 2015 6:17 am

DaveJ wrote:Not sure if this has been covered but when I try to read the variable of the elapsed time on a timer, it always shows '0' as the time as in it doesn't seem to update.
Am I doing something wrong?
Thanks
Dave J


I think you need to post your code to be clear. It works for me.

Have you started the timer automatically as the page loads or do you start it manually?

Here is sample code. Create a new pub (320x200) and paste this code into it to test:

Code: Select all
{NeoBook 5 Objects}
NeoBookVer=5.80
ObjectType=3
Name=PushButton1
X=63
Y=83
W=206
H=64
Anchor=0
Text=Elapsed Time
Align=2
ImageStyle=0
ObjAction=Math "[elapsed]/1000" "" "[seconds]"¶AlertBox "test" "This is how many seconds that have elapsed|since the page was loaded|and the timer was started:|[seconds]"
LineColor=0
LineWidth=1
LineStyle=0
FillColor=12632256
FillPattern=0
Font=MS Sans Serif
FontSize=8
FontStyle=0
FontCharset=1
TextColor=0
TabOrder=2
ObjectType=15
Name=Timer1
X=352
Y=105
W=32
H=32
Anchor=0
Interval=1000
VarName=[elapsed]
David Payer
Des Moines, Iowa
USA
User avatar
dpayer
 
Posts: 1384
Joined: Mon Apr 11, 2005 5:55 am
Location: Iowa - USA

Re: Timer not updating the elapsed time

Postby DaveJ » Wed Jan 14, 2015 3:05 pm

Thanks David,
I got it looking at you example. I was setting a timer of 60000 expecting to see it count to zero.
So really it is a counter multiplied by the delay time.
Thanks for your help
DaveJ
 
Posts: 90
Joined: Tue Dec 30, 2008 11:06 am


Return to General NeoBook Discussions

Who is online

Users browsing this forum: No registered users and 2 guests