For example, if the data stored in the table ( or Excel sheet ) is 12th Aug 2009, the value read is 12th Aug 2009 PLUS one millisecond. Here is a test program:
- Code: Select all Expand view
- #include "fivewin.ch"
function Main()
local oExcel, oBook, oSheet
local dWrite, dRead
SET DATE ITALIAN
SET CENTURY ON
oExcel := CreateObject( "Excel.Application" )
oBook := oExcel:WorkBooks:Add()
oSheet := oExcel:ActiveSheet
dWrite := STOD( "20090812" )
oSheet:Cells( 1, 1 ):Value := dWrite
dRead := oSheet:Cells( 1, 1 ):Value
msginfo( "Written : Read" + CRLF + ;
"DTOC " + DTOC( dWrite ) + " : " + DTOC( dRead ) + CRLF + ;
"TTOC " + TTOC( dWrite ) + " : " + TTOC( dRead ) + CRLF + ;
"TTOS " + TTOS( dWrite ) + " : " + TTOS( dRead ), ;
If( dWrite == dRead, "EQUAL", "NOT EQUAL" ) )
oBook:Close()
return nil
The equality comparison returns false. In earlier versions this was working perfectly.
I noticed this when I was rebuilding a large project. All those modules which depended or date comparisons are going haywire. An easy workaround to compare DTOC instead of dates can be recommended, but it is not practically possible to search through a large software and replace.
Has anyone noticed this problem and any news of fixing this bug ?