Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Newcomers DBPro Corner / Can someone tell me why my timer variable won't reset [DBP]

Author
Message
Steel
18
Years of Service
User Offline
Joined: 7th Apr 2006
Location:
Posted: 19th May 2006 21:03
Pleas Help
zenassem
21
Years of Service
User Offline
Joined: 10th Mar 2003
Location: Long Island, NY
Posted: 19th May 2006 21:15 Edited at: 19th May 2006 21:22
You already posted this, and Iam M answered you. You can't reset the system timer. It's a Read Only function.

MyTime=timer()

If you look at the code snippet in your other thread you will see that it can be simulated. You just use whatever the starttime is and then subtract any further time.

so StartTime would be:


Please have another look at Ian M's Snippet.
Steel
18
Years of Service
User Offline
Joined: 7th Apr 2006
Location:
Posted: 19th May 2006 21:23
I had source code there and I needed help with that.
zenassem
21
Years of Service
User Offline
Joined: 10th Mar 2003
Location: Long Island, NY
Posted: 19th May 2006 21:27 Edited at: 19th May 2006 21:33
OOps sorry. I didn't see the source button. I'll have a look now and see if i can find the problem.

[edit] OK I had a look at it. It's just hard to follow at all that multiple nested code without some form indentation and specing. I don't have my DBpro editor right now, but I can take a look later tonight if no one else has helped you by then.
IanM
Retired Moderator
22
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 20th May 2006 01:49
@Steel,

I've indented the code for you. You really should make this a habit, as you will only be helping yourself in the long run as your programs get longer - the structure becomes immediately apparent with indentation.

Unfortunately, I'm too tired ATM to work out exactly what this code is doing right now, especially without any clues or jpgs to work with, so I'm gonna leave it here tonight.

Still no sense wasting the time spent on indenting ...


For free Plug-ins and source code http://www.matrix1.demon.co.uk
Pincho Paxton
21
Years of Service
User Offline
Joined: 8th Dec 2002
Location:
Posted: 20th May 2006 02:41
I do this...

if Start <= Timer()
Start = Timer() + 240000
(Then do your code)

Endif

But for the second loop you can't use Start again, because you mustn't change it twice. You would have to use Start2 or something. You are using it several times, and I think you keep resetting it before it should be reset, although it is hard to tell.

Login to post a reply

Server time is: 2024-11-27 19:47:02
Your offset time is: 2024-11-27 19:47:02