Advertisement
Guest User

Untitled

a guest
Nov 22nd, 2017
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Delphi 0.81 KB | None | 0 0
  1. procedure TForm1.N2Click(Sender: TObject);
  2. var
  3.   f:Textfile;
  4.   temp, x, y, i, delphishlak: integer;
  5.   tempstr, shit: string;
  6. begin
  7.   assignfile(f,'Сотрудники.txt');
  8.   reset(f);
  9.   readln(f, temp);
  10.   StringGrid1.colcount := temp;
  11.   readln(f, temp);
  12.   StringGrid1.rowcount := temp;
  13.   for X := 0 to StringGrid1.colcount - 1 do
  14.     for y := 0 to StringGrid1.rowcount - 1 do
  15.       begin
  16.         readln(F, tempstr);
  17.         StringGrid1.cells[x, y] := tempstr;
  18.       end;
  19.   closefile(f);
  20.   stringgrid1.Visible:=true;
  21.   stringgrid1.Cells[9,0]:='Стаж';
  22.     for i:=1 to StringGrid1.rowcount - 1 do
  23.       begin
  24.         shit := StringGrid1.Cells[5,i];
  25.         Delete(shit, 1, 6);
  26.         delphishlak := 2017 - StrToInt(shit);
  27.         StringGrid1.Cells[9,i]:=IntToStr(delphishlak);
  28.       end;
  29. end;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement