Показать сообщение отдельно
  #2  
Старый 17.11.2009, 16:20
Ztrel Ztrel вне форума
Прохожий
 
Регистрация: 10.08.2009
Сообщения: 25
Репутация: 10
Сообщение

Код:
procedure TForm1.Button1Click(Sender: TObject);
var
  f:textfile;
  tmp_str:string;
  tmp_lst:TStrings;
  i,j,k:integer;
begin
Form5.Visible:= True;
Form1.Visible:= False;
  tmp_lst:=TStringList.Create;
  If FileExists('Ученики.txt') then
    begin
      Form5.StringGrid1.Visible:=true;
      AssignFile(f, 'Ученики.txt');
      Reset(f);
      While not Eof(f) do
        begin
          readln(f,tmp_str);
          if tmp_str = '*' then
          continue
          else
          tmp_lst.Add(tmp_str);
        end;
      Form5.StringGrid1.RowCount:=((tmp_lst.Count) div 6)+1;
      k:=0;
      for j:=1 to Form5.StringGrid1.RowCount-1 do
        for i:=1 to Form5.StringGrid1.ColCount-1 do
          begin
            Form5.StringGrid1.Cells[i,j]:=tmp_lst[k];
            inc(k)
          end;
 
    end
  else ShowMessage('File is not exist')
end;


Вопрос снят. Ответ - только что написан )) Спасибо всем, кто дернулся )