I have been trying to write out data to storage when the form closes or the application terminates and have NOT been successful.
I first tried from the Form unit
procedure TForm1.FinalizeObject;
begin
inherited;
SaveData;
end;
and
procedure TForm1.FinalizeObject;
begin
SaveData;
inherited;
end;
neither of these attempts worked, therefore I rrearranged my code and tried it from the project’s unit
procedure TApplication.ApplicationClosing;
begin
SaveData;
inherited;
end;
and
procedure TApplication.ApplicationClosing;
begin
inherited;
SaveData;
end;
I have a w3_showmessage as the first line of SaveData, and it never gets called ever....so, if i can verify that one of these 4 methods is triggered, i could use one of them
What am i doing wrong? Thanks
As of writing, Smart exposes two new events in the application object:
These will make it easier to handle shutdown sequences. The smart javascript bootstrap also calls application.terminate() automatically now, so your code should work fine.