Saving and Loading Chart from file problems (Please help)
Posted: Tue Jul 11, 2006 11:39 am
Hi.
I am having a problem Saving and Loading charts from file.
Here are the 2 procedures:
procedure TfrMain.GraphSaveClick(Sender: TObject);
begin
GraphName := PopupMenuGraph.PopupComponent.Name;
frSave.Show;
end;
procedure TfrMain.GraphOpenClick(Sender: TObject);
var tmpChart:TCustomChart;
File_name: String;
begin
GraphName := PopupMenuGraph.PopupComponent.Name;
For Search := 1 to 40 do
Begin
If GraphName = Graph[Search].Name then
Begin
Found := Search;
Break;
end;
end;
frOpen.Showmodal;
Graph[Found].Free;
tmpChart:=TChart.Create(Self);
File_name := saveUnit.File_name + '.tee';
LoadChartfromFile(tmpChart,File_name);
Graph[Found] := tmpChart as TChart;
Graph[Found].Parent := Page1;
end;
And the other 2:
procedure TfrOpen.btnAcceptClick(Sender: TObject);
begin
File_name := Filelistbox1.Directory + '\' + Filenameedit.Text;
File_name2 := Filelistbox1.Directory + '\';
frOpen.Close;
Closed := false;
end;
procedure TfrSave.btnAcceptClick(Sender: TObject);
var Search, Found: integer;
begin
File_name := Filelistbox1.Directory + '\' + Filenameedit.Text;
File_name2 := Filelistbox1.Directory + '\';
For Search := 1 to 40 do
Begin
If GraphName = Graph[Search].Name then
Begin
Found := Search;
Break;
end;
end;
SaveChartToFile(Graph[Found],File_name,True);
frSave.Close;
Closed := false;
end;
Hope it makes sense. Ask if it doesnt. It doesnt work though. And ive tried everything. :/
Thanks in advance.
Regards
Justin aka thr4sh3r
I am having a problem Saving and Loading charts from file.
Here are the 2 procedures:
procedure TfrMain.GraphSaveClick(Sender: TObject);
begin
GraphName := PopupMenuGraph.PopupComponent.Name;
frSave.Show;
end;
procedure TfrMain.GraphOpenClick(Sender: TObject);
var tmpChart:TCustomChart;
File_name: String;
begin
GraphName := PopupMenuGraph.PopupComponent.Name;
For Search := 1 to 40 do
Begin
If GraphName = Graph[Search].Name then
Begin
Found := Search;
Break;
end;
end;
frOpen.Showmodal;
Graph[Found].Free;
tmpChart:=TChart.Create(Self);
File_name := saveUnit.File_name + '.tee';
LoadChartfromFile(tmpChart,File_name);
Graph[Found] := tmpChart as TChart;
Graph[Found].Parent := Page1;
end;
And the other 2:
procedure TfrOpen.btnAcceptClick(Sender: TObject);
begin
File_name := Filelistbox1.Directory + '\' + Filenameedit.Text;
File_name2 := Filelistbox1.Directory + '\';
frOpen.Close;
Closed := false;
end;
procedure TfrSave.btnAcceptClick(Sender: TObject);
var Search, Found: integer;
begin
File_name := Filelistbox1.Directory + '\' + Filenameedit.Text;
File_name2 := Filelistbox1.Directory + '\';
For Search := 1 to 40 do
Begin
If GraphName = Graph[Search].Name then
Begin
Found := Search;
Break;
end;
end;
SaveChartToFile(Graph[Found],File_name,True);
frSave.Close;
Closed := false;
end;
Hope it makes sense. Ask if it doesnt. It doesnt work though. And ive tried everything. :/
Thanks in advance.
Regards
Justin aka thr4sh3r