====== Jeffrey D. Smith ====== wrote 2006-10-28 20:01:
...
date=DATE(U)
time=TIME()
...
Say 'Rexx Date/Time:' date time
Do not do this. There's a (small) chance that the date will change
between the two calls, and the result printed will be in error
by 24 hours; a nasty bug for being almost impossible to reproduce.
Rather, do:
Say 'Rexx Date/Time:' DATE(U) TIME()
I recognize this is a one-off, but as mentioned recently in these
lists, one-time code has a nasty habit of creeping into production,
as do careless habits practiced in one-time code.
-- gil
There is still a small(er) chance that the date changes between the
resolution of the Date() function and the resolution of the Time()
function. (AFAIK)
Haven't found a really "clean" solution to this problem. Anyone ?
Thomas Berg
Could you get the date before and after getting the time. Then
check the two dates for a match? If mismatch, then loop back and
try again.
Of course You could do that.
But if we are very (unreasonable) picky; there is a problem with that:
You are not guaranteed to get out of that loop (as if there were a very
bizarre delay in the execution of the code).
Another catch: You maybe really wants the initial value (the first date
is the "right" one).
I think a solution could be using e g "Time('B')" as the first function (?).
Thomas Berg
--
__________________________
Mundus Vult Decipi
__________________________
They that can give up essential liberty to obtain a little temporary safety
deserve neither liberty nor safety.
- Benjamin Franklin
Military justice is to justice what military music is to music.
- Groucho Marx
----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [EMAIL PROTECTED] with the message: GET IBM-MAIN INFO
Search the archives at http://bama.ua.edu/archives/ibm-main.html