BBC BASIC for Windows
« Upper limit of TIME variable »

Welcome Guest. Please Login or Register.
Apr 5th, 2018, 11:49pm



ATTENTION MEMBERS: Conforums will be closing it doors and discontinuing its service on April 15, 2018.
Ad-Free has been deactivated. Outstanding Ad-Free credits will be reimbursed to respective payment methods.

If you require a dump of the post on your message board, please come to the support board and request it.


Thank you Conforums members.

BBC BASIC for Windows Resources
Online BBC BASIC for Windows documentation
BBC BASIC for Windows Beginners' Tutorial
BBC BASIC Home Page
BBC BASIC on Rosetta Code
BBC BASIC discussion group
BBC BASIC for Windows Programmers' Reference

« Previous Topic | Next Topic »
Pages: 1  Notify Send Topic Print
 thread  Author  Topic: Upper limit of TIME variable  (Read 568 times)
marcellooct1942
New Member
Image


member is offline

Avatar




PM


Posts: 3
xx Re: Upper limit of TIME variable
« Reply #2 on: Feb 1st, 2014, 09:31am »

Thank you Richard for the explanation.
I may agree that a continuous run of 16 months is unlikely to happen, but I have programs running since 5 years at customer premises of which I have no control.
I presume the customer has restarted the program sometime in the mean time but I cannot be certain about that.
In effect I am using statements like T%=TIME and that is why I was concerned about the top limit.
Just for precaution all variables concerned with comparison against TIME are zeroized once a day as well as TIME is.
May be in the future I could just verify the current TIME value and then take some action only if its value exceeds &07FFFFFF.
Thank you again

Marcello
User IP Logged

JGHarston
Junior Member
ImageImage


member is offline

Avatar




Homepage PM

Gender: Male
Posts: 52
xx Re: Upper limit of TIME variable
« Reply #3 on: Feb 5th, 2014, 09:05am »

on Feb 1st, 2014, 09:31am, marcellooct1942 wrote:
Just for precaution all variables concerned with comparison against TIME are zeroized once a day as well as TIME is.
What I prefer to do is not zero TIME, but subtract 24*60*60*100, something like:
REPEAT
T%=TIME
IF T%>=8640000 THEN TIME=TIME-8640000
UNTIL T%<8640000

User IP Logged

marcellooct1942
New Member
Image


member is offline

Avatar




PM


Posts: 3
xx Re: Upper limit of TIME variable
« Reply #4 on: Feb 5th, 2014, 09:13am »

Good point.... I accept the suggestion.
The constant shall be subtracted both from TIME and from all the variables used in the program that are compared against TIME.
Thank you



User IP Logged

admin
Administrator
ImageImageImageImageImage


member is offline

Avatar




PM


Posts: 1145
xx Re: Upper limit of TIME variable
« Reply #5 on: Feb 5th, 2014, 12:05pm »

on Feb 5th, 2014, 09:05am, JGHarston wrote:
What I prefer to do is not zero TIME, but subtract 24*60*60*100

Yes, and of course you can choose to subtract anything convenient - it doesn't have to be a period of one day. You could for example round it up to 10000000 centiseconds.

But I still think that, since (unsigned) TIME won't 'wrap around' until the program has been running for more than 16 months, it's hardly worth bothering.

Richard.
User IP Logged

Pages: 1  Notify Send Topic Print
« Previous Topic | Next Topic »

| |

This forum powered for FREE by Conforums ©
Terms of Service | Privacy Policy | Conforums Support | Parental Controls