3
votes

I upgraded one project from XE to XE2 and I noticed that DateToStr doesn't work exactly as before.

If I try to covert a null date to str it gives "Invalid floating point operation". While this was not there in XE.

Why there is this difference? Are there similar behaviours for other functions? (I mean some function that in a similar case = converting a null value changes the behaviour)

1
Perhaps this is what you are referring to: stackoverflow.com/questions/9255337/…David Heffernan
Can you show some code? Passing an uninitialized TDateTime just returns 30/12/1899 on my machine.pritaeas
@pritaeas You mean passing a TDateTime that has value of 0.0.David Heffernan
Yes, is that not what he's referring to ?pritaeas
@pritaeas Probably not because a value of 0.0 does not throw an FP errorDavid Heffernan

1 Answers

1
votes

After investigating I realized that this design choice made by Embarcadero in XE2 will affect a lot of old code. Wherever possible I replaced DateTimeToStr or I added checks for NULL dates before trying to convert to string.

Also DevExpress have some problems with their components because of this issue.