Page 1 of 1

LoadChartFromFile

Posted: Fri Apr 30, 2004 3:22 pm
by 9335230
Hi there,
I would like to know if the Chart parameter passed in the LoadChartFromFile function is deleted and re-created (with a new) within this function or if it is in the same memory address. It seems to be the same but I am not sure.


Thanks a lot.

Posted: Sat May 01, 2004 7:25 am
by Marjan
Hi.

Not exactly. Only the chart series and tools are freed. Then the object is repopulated with data. Here is the relevant code from TeeStore.pas implementation:

Code: Select all

Procedure LoadChartFromStreamCheck( Var AChart:TCustomChart;
                                    AStream:TStream;
                                    ACheckError:TProcTeeCheckError=nil;
                                    TryReadData:Boolean=True);

    { remove all child Series and Tools }
    AChart.FreeAllSeries;
    AChart.Tools.Clear;
    // ...

Posted: Thu May 13, 2004 2:58 pm
by 8577282
Then, is there a LoadChartFromStream that takes a value parameter? With the reference parameter, I have to first assign my TChart to a TCustomChart before calling the procedure.