procedure TForm7.FormActivate(Sender: TObject); var i: integer; t,r: tstringlist; begin StatusBar1.Panels[0].Text:=Form1.CheckListBox1.Items.ValueFromIndex[Form1.CheckListBox1.ItemIndex]; try t:=tstringlist.Create; r:=tstringlist.Create; begin t.LoadFromFile('files/Res/Prepod/1.'+inttostr(Form1.CheckListbox1.ItemIndex)+'spisok.txt'); for i:=1 to stringgrid1.RowCount-1 do stringgrid1.Rows[i].Clear; stringgrid1.ColCount:=1; stringgrid1.RowCount:=t.Count; for i:=1 to t.Count-1 do begin r.DelimitedText:=t[i]; if r.Count>stringgrid1.ColCount then stringgrid1.ColCount:=r.Count; stringgrid1.Rows[i].Assign(r); end; end; except on E:exception do showmessage('Файла не существует'); end; end; There is a code that unloads data from a file inside the root folder and outputs it to a StringGrid . How to make the inverse function?
Here is the input information: 
And it turns out outgoing if I unload already from the table. 
How to make it save as input?