I probably misunderstood you because you were saying "output data arrays are currently local".
Sorry, that were me who was not clear enough. I wrote the "calculation" part of the code separately and then, trying to fit it into the form, realized the problem with local data array and UserDefinedChartSource handler. The first instinctive move was to make the array global, which I did, and it works fine. However, I thought that there might be another way of doing the same thing, while keeping the data array local.
In principle, it could also have been declared within TAChart as "nested" (i.e. a "local" procedure within another procedure) but this will not work because the event handler is needed as long as the UserDefinedChartSource exists since the chart must be able to redraw itself and its series at any time; in case of a nested procedure the event handler would no longer be available once the outer procedure has been left.
That might work for me, actually. So, if I declare procedure
UserDefinedChartSource0GetChartDataItem within procedure
bRunClick, I think I still will be able to plot the graph from within procedure
bRunClick. This is the end of the whole program, and any other manipulations would mean starting the whole program from the very beginning and the current graph won't be needed any more. Not sure if I managed to explain it, though...
I can show the whole code or, if I manage to nest
UserDefinedChartSource0GetChartDataItem in
bRunClick I'll see if the result suits my needs
. Or do I have to declare it somewhere else? Do I need to specifically alter the syntax of declaration of
UserDefinedChartSource0GetChartDataItem when it's inside
bRunClick or is it considered as a "regular" procedure within another procedure?
Thank you.
P.S. Sorry for bugging, just really want to know how to make it one and another way.