Another (expensive) hit on bug #130180
Chris.Sharman@ccagroup.co.uk
Chris.Sharman@ccagroup.co.uk
Tue, 17 Feb 1998 10:27:23 GMT
Environment: Alpha VMS 6.2, PH 7.10.F3, Quick, bug 130180 (VMS specific).
Offending piece of code:
if (discount-start-date <= vmstimestamp) and &
(discount-end-date >= vmstimestamp)
then {apply discounts}
We do sale or return at Christmas, and we've just overcredited huge amounts of
money. It's all my fault, because I wrote the above piece of code.
The above piece of code fails because, although both items and the function are
dates of VMSdate type, Powerhouse treats the two items as numbers of the form
19980101.1234..., and treats the vmstimestamp function result as an integer
(specifically the number of nanoseconds since 1858, or some such crap: a number
in the millions of billions, always greater than a date).
This bug's been around for at least two years to my knowledge, probably longer.
The workaround is to do "define now vmsdate = vmstimestamp", and compare
against now: trivial enough if you remember to do it. Potentially bloody
expensive if you don't. When are we going to get a fix so that vmstimestamp
works properly ?
______________________________________________________________________
Chris Sharman Chris.Sharman@CCAgroup.co.uk
CCA Stationery Ltd, Eastway, Fulwood, Preston, Lancashire, PR2 9WS.