Dialog for Save does not show previously opened file lazarus / 31-LCL ---------------------------------------------------------------------- Elmug · 2011-08-27 09:54 Good people, When The button that saves a text file that was brought in for editing in a TMemo box is pressed, the dialog and the saving take place, but  a disadvantage is that the filename is blank, whereas it would be much better if the filename originally read were in there as the best option for filename, as is the case usually. I am not sure of what I have missed that needs to be done. The code is basically as follows: TO LOAD THE FILE:    if openDialog1.Execute then       begin         ReadName := OpenDialog1.FileName;         Memo1.Lines.LoadFromFile(ReadName);     end; TO SAVE THE FILE:       if SaveDialog1.Execute then        Memo1.Lines.SaveToFile(SaveDialog1.FileName);       endif; I tried countless ways to get the read filename onto the Save mechanism, but was not good enough for that. Would appreciate some help! Thanks! ---------------------------------------------------------------------- User137 · 2011-08-27 10:21 Code: [Select] if openDialog1.Execute then       begin         SaveDialog1.FileName:=OpenDialog1.FileName; // <--- added         ReadName := OpenDialog1.FileName;         Memo1.Lines.LoadFromFile(ReadName);     end; ---------------------------------------------------------------------- Elmug · 2011-08-27 14:36 Thanks User137. It worked right away. I must have tried it the other way around at least 100 time!