Witam mam taki problem. Poniższy program ma generować plansze i wyświetlać ją na formularzu a losowo wygenerowane tagi mają być zapisywane do pliku. Na początku wszystko było ok ale w pewnym momencie po ponownym włączeniu delphi pojawia sie tylko pusty formularz a plik tez sie nie tworzy ;/

o co może chodzić ?

unit Unit5;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls;

type
  TForm1 = class(TForm)
    procedure FormCreate(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

{$R *.dfm}
procedure TForm1.FormCreate(Sender: TObject);
  var b:TButton;
    i,j:byte;
    tab:array[0..10,0..10] of integer;
    TF:TextFile;
  begin
    randomize;
    AssignFile(TF,'C:\plik.txt');
    try rewrite(TF);
      for i:=0 to 10 do
      begin
      writeln(TF);
        for j:=0 to 10 do
          begin
          b:=TButton.Create( self );     
          b.Tag:=random(2);              
          tab[i,j]:=b.Tag;              
          write(TF,IntTOstr(tab[i,j]));                             
          b.caption:=inttostr(b.tag);
          b.height:=30;
          b.width:=30;
          b.Top:=15+30*j;
          b.left:=10+30*i;
          b.Parent:=self;
          end;
      end;
    finally
      closefile(TF);
    end;
  end;

end.