Steema Issues Database

Note: This database is for bugs and wishes only. For technical support help, if you are a customer please visit our online forums;
otherwise you can use StackOverflow.
Before using this bug-tracker we recommend a look at this document, Steema Bug Fixing Policy.



Bug 531

Summary: About the data size of AddArray function in C++ Builder.
Product: VCL TeeChart Reporter: narcís calvet <narcis>
Component: SeriesAssignee: Steema Issue Manager <issuemanager>
Status: RESOLVED NOTABUG    
Severity: normal CC: david, wave, yeray
Priority: ---    
Version: 131119   
Target Milestone: ---   
Hardware: PC   
OS: Windows   
URL: http://www.teechart.net/support/viewtopic.php?f=3&t=14587
Chart Series: --- Delphi / C++ Builder RAD IDE Version:

Description narcís calvet 2014-01-09 04:37:21 EST
According to the description of AddArray function, the second parameter means the data number of the first parameter? But actually it is the data number - 1 ? So if I have a array of 10 elements, I should add data like below?

   double array[10] = {1, 2,3,4,5,6,7,8,9,10};
   Series1->AddArray(array, 9);
Comment 1 david berneda 2014-01-13 04:53:04 EST
Solution:

Series1->AddArray(EXISTINGARRAY(array));

Explanation:

This is a confusing problem with Delphi compiler generating the *.hpp header file.
The second parameter is misleading, named "size" but in reality it is passed the High(array) value ( Count - 1 )

http://docwiki.embarcadero.com/RADStudio/XE5/en/VCL_Compatibility_Macros

We cannot control the param name, it is generated automatically by Delphi compiler.
Comment 2 yeray alonso 2023-12-15 02:28:59 EST
Just adding the link to the latest version of the docwiki explanation, since the previous link doesn't work any more.

http://docwiki.embarcadero.com/RADStudio/en/Special:Search/Delphi%20Compatibility%20Macros