A Silly Problem with Dates (OpenInsight 32-bit Specific)
At 23 AUG 2002 02:46:17PM Mike Parrish wrote:
Me again…
In our Customer_Orders window, we have an edittable (Order_Versions)that tracks revisions of the customer PO. The fields are VERSION, VERSION_DATE and VERSION_COMMENTS. The first row of the table is always the original version of the cust PO and date should be the same as the data entered in the edit line control ORDER_DATE. In the default property for VERSION_DATE, I have a call to the commuter module to provide the value in ORDER_DATE as the default value for Row 1 of VERSION_DATE. The code is:
DFLT_VERSION_DATE:
sp =get_property( @window : ".ORDER_VERSIONS", "SELPOS" )
if sp=1 then
* if on the first row, it is the original version & date should be
* the same as the order date.
ANS=GET_PROPERTY( @window : ".ORDER_DATE", "TEXT" )end else
* if not on the first row, the date will be the PO change date, but
* offer current date as the default.
ANS=DATE()end
RETURN ANS
Pretty simple, so I thought. However, when I test it in the window, the default for VERSION_DATE on row 1 always returns 12/31/67 – the internal zero date. But when I display the value retrieved from ORDER_DATE in a MSG call, the ANS returns whatever is found in ORDER_DATE (eg., 8/23/02). I've tried iconv, oconv, iconv(oconv…) oconv(iconv…)-ing the value of ANS after the GET_PROPERTY, and always get 12/31/67 on row 1. I'm stumped. ORDER_DATE and VERSION_DATE are dict-defined with validation of (D) and oconv as 'D2/'.
Any suggestions? I find this very odd. ;)
Mike
At 23 AUG 2002 04:49PM David Pociu wrote:
Mike,
My guess is that by getting the "TEXT" property, you get the date in external value into ANS (and then set it as an internal value, which of course would get oconv-ed into date 0)
Try getting the "INVALUE" property instead of "TEXT"
Hope this solves it,
Dave
At 23 AUG 2002 07:58PM Mike Parrish wrote:
Dear David,
Ah!!! Thanks! I looked at as many properties as I could think of but INVALUE was not one of them. I'd probably have never come to it on my own. I'll give it a shot and will know better in the future to look more closely at these things.
Mike