procedure TForm1.Button2Click(Sender: TObject);// вивести дані var f: textfile; j: integer; s: string; begin // кількість рядків в таблиці StringGrid буде на 1 перевищувати // кількість учнів (+1 рядок для шапки) StrSpusok.RowCount:= i+1; //виведення шапки таблиці StrSpusok.Cells[0,0]:='№ п/п'; StrSpusok.Cells[1,0]:= 'Прізвище'; StrSpusok.Cells[2,0]:= 'Ім''я'; StrSpusok.Cells[3,0]:= 'Дата народж. '; StrSpusok.Cells[4,0]:= 'Середній бал'; //Заповнення таблиці StrSpusok даними про учнів for j :=1 to i do begin StrSpusok.Cells[0,j]:= IntToStr(j); StrSpusok.Cells[1,j]:= x[j-1].prizv; StrSpusok.Cells[2,j]:= x[j-1].name; StrSpusok.Cells[3,j]:= x[j-1].data; StrSpusok.Cells[4,j]:= floattostr(x[j-1].s_ball); end; //виведення результатів у текстовий файл AssignFile(f, 'student.txt'); Rewrite(f); for j :=1 to i do writeln(f,j,x[j-1].prizv:20,x[j-1].name:15,x[j-1].data:15,' Sr_ball= ',x[j-1].s_ball:4:1); closefile(f); end;