Hi,
I'm having this problem with the TSaveDialog. When i attempt to save data to a binary file it doesnt save the file to the path I browse to in the dialog box. I assume i have to do something like setdir but after trawling google and these forums, i've found nothing of use.
Thanks in advance.
Heres my code:
procedure Tpacker_main.btnsaveClick(Sender: TObject);
var
filename: string;
openfile: file of Tsave;
Data: Tsave;
ObjectWidthSave: string;
begin
saveDialog.Filter := '*.dat';
saveDialog.DefaultExt := 'dat';
saveDialog.FilterIndex := 0;
SaveDialog.Execute;
filename := SaveDialog.Filename;
edit_loadsave.Text := filename;
Data.ObjectWidthSave := FloatToStr(ObjectWidth);
Data.ObjectHeightSave := FloatToStr(ObjectHeight);
Data.ObjectDepthSave := FloatToStr(ObjectDepth);
Data.ObjectMassSave := FloatToStr(ObjectMass);
Data.PackagingThicknessSave := FloatToStr(PackagingThickness);
Data.PackagingMassSave := FloatToStr(PackagingMass);
Data.MaterialThicknessSave := FloatToStr(MaterialThickness);
Data.PlywoodDensitySave := FloatToStr(PlywoodDensity);
Assignfile(openfile, filename);
rewrite(openfile);
Write(openfile, Data);
CloseFile(openfile);
end;