----- Original Message -----
From: "Jeff Johnson" <[email protected]>
I would
expect date() - {//} to be = date(). It probably doesn't because it is
an "empty" date and not a valid date.
Not at all.
As Lew said, the difference between two dates is not a date but a number.
"empty date" is a valid date, but this special value has special effects.
You tried datetime()-{//} ; would you expect datetime() - (datetime()-1)
to answer you a date instead of a number ?
When using dates, many people think we're using a mathematical
"set of dates", bijectivly joined to the natural set of numbers (N)
to which we apply relational operators and order.
But it is not the truth.
The relations between dates and N are not morphisms.
Dates are obtained using a complicated transformation function
(and that's why internally, the computer doesn't store dates
but numbers, working with numbers and encoding and decoding them
on the fly).
So, the appearance of a date is in reality a function f(d), and the
operations made with it (add, subtract) are compositions of this primitive.
And there is no simple (mathematically) reverse one.
So you can't apply the usual mathematical rules as you would do
within the N set, you must comply with the function composition rules.
Adding to this, Foxpro supersede some mathematical rules,
so in the definition of the date() function, {//} is a "aggregator"
(i don't know if this word exist) like .null. is one for logical operators.
G.
_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://mail.leafe.com/mailman/listinfo/profox
OT-free version of this list: http://mail.leafe.com/mailman/listinfo/profoxtech
Searchable Archive: http://leafe.com/archives/search/profox
This message:
http://leafe.com/archives/byMID/profox/8051D794927B4B1C9C8FFBF0D9E23851@MuriellePC
** All postings, unless explicitly stated otherwise, are the opinions of the
author, and do not constitute legal or medical advice. This statement is added
to the messages for those lawyers who are too stupid to see the obvious.