Recent

Author Topic: [SOLVED] TChartSeries.AddNull raises an external FLOAT exception on WIn32  (Read 1602 times)

dsiders

  • Hero Member
  • *****
  • Posts: 1052
I had to recompile an application that I had not touched for a while, a found that TListChartSource.AddNull now raises an exception that never happened in the past. This is on Windows 8.1

I replaced TChartSeries.AddNull('') with TChartSeries.ListSource.Add(iPos, SafeNan) - which is what AddNuill does but with an actual value for the X-axis. IOW Add(SafeNan, SafeNan) raises an exception but giving an x-axis value does not.

Have you seen this before? And should I file a bug report?
« Last Edit: May 06, 2023, 06:20:26 pm by dsiders »
Preview Lazarus 3.99 documentation at: https://dsiders.gitlab.io/lazdocsnext

wp

  • Hero Member
  • *****
  • Posts: 11855
Your description is a bit misleading because TListChartSource does not have such a method, but TChartSeries has. But calling AddNull to an otherwise empty TLineSeries does indeed lead to an exception.

Should be fixed now in Laz/main, and I added a unit test for it. Please test, I am not 100% sure if the fix is correct.

dsiders

  • Hero Member
  • *****
  • Posts: 1052
Your description is a bit misleading because TListChartSource does not have such a method, but TChartSeries has. But calling AddNull to an otherwise empty TLineSeries does indeed lead to an exception.

Should be fixed now in Laz/main, and I added a unit test for it. Please test, I am not 100% sure if the fix is correct.

Sorry about the bad description. And Thanks for the quick fix. I should be able to try it out in a couple of hours.
Preview Lazarus 3.99 documentation at: https://dsiders.gitlab.io/lazdocsnext

dsiders

  • Hero Member
  • *****
  • Posts: 1052
Your description is a bit misleading because TListChartSource does not have such a method, but TChartSeries has. But calling AddNull to an otherwise empty TLineSeries does indeed lead to an exception.

Should be fixed now in Laz/main, and I added a unit test for it. Please test, I am not 100% sure if the fix is correct.

Sorry about the bad description. And Thanks for the quick fix. I should be able to try it out in a couple of hours.

I can confirm that TChartSeries.AddNull no longer raises the FLOAT exception in my use case. Thanks again.
Preview Lazarus 3.99 documentation at: https://dsiders.gitlab.io/lazdocsnext

 

TinyPortal © 2005-2018