Page 1 of 1

Bug:TSurfaceSeries access violation, Teechart pro 7, BDS2006

Posted: Fri Jan 16, 2009 9:03 pm
by 9349409
Iterating through my data by calling AddXYZ like this:

for z := 25000 downto 0 do
for x := 1 to 1000 do
AddXYZ(x, y, z);

will cause an access violation. This is not the case if the loop on Z ascends rather than descends, ie.

for z := 0 to 25000 do...

works fine. This is because in TeeSurfa.TCustom3DGridSeries.FillGridIndex,
the call to SearchZvalue calls SearchSorted in order to avoid adding duplicate values to the ZVals array. But since ZVals is sorted in reverse, many duplicates are added to this array, overflowing your 20000 limit.

The IrregularGrid property must also be set to TRUE for this access violation to occur.

I haven't seen anything in the docs requiring that the calls to AddXYZ must occur with an ascending Z value.

Is there something I missed?

Posted: Mon Jan 19, 2009 10:07 am
by narcis
Hi Alan,

I've been able to reproduce the issue here and added it (TV52013753) to the defect list to be fixed for future releases. In the meantime you should populate the series in an ascending loop without the need to use IrregularGrid=true here:

Code: Select all

  for z := 0 to 25000 do
    for x := 1 to 1000 do
      Series1.AddXYZ(x, random, z);