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.
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
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
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.