Показать сообщение отдельно
  #1  
Старый 30.10.2009, 17:03
JigaGun JigaGun вне форума
Прохожий
 
Регистрация: 30.10.2009
Сообщения: 3
Репутация: 10
Вопрос Вопрос по Record

Проблема в коде или голове, подскажите выдает ошибку: [Error] Unit1.pas(69): Illegal type in Write/Writeln statement

САМ КОД:
Код:
unit Unit1;

interface

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

type
   TForm1 = class(TForm)
    StringGrid1: TStringGrid;
    Button1: TButton;
    Button2: TButton;
    Edit1: TEdit;
    Edit2: TEdit;
    Button3: TButton;

   {TStation = Record
    StationNumber: Integer;
    StationAdress: String;
   end;}

    procedure FormCreate(Sender: TObject);
    procedure Button3Click(Sender: TObject);

  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  //Station: TStation;
  Form1: TForm1;
  File1: File of Byte;

implementation

{$R *.dfm}

procedure TForm1.FormCreate(Sender: TObject);
begin
  StringGrid1.Cells[0,0] := '№ станции';
  StringGrid1.Cells[1,0] := 'Адресс';
end;


procedure TForm1.Button3Click(Sender: TObject);
type
  TStation = Record
    StationNumber: String[6];
    StationAdress: String[40];
  end;
Var
  Station: TStation;
  Config: File of TStation;

begin
  //Station.StationNumber := Edit1.Text;
  //Station.StationAdress := Edit2.Text;
  AssignFile(Config,'Config.rgv');
  ReWrite(Config);
  try
    With Station do
      begin
        StationNumber := Edit1.Text;
        StationAdress := Edit2.Text;
      end;
    WriteLn(Config, Station);
  finally
  CloseFile(Config);
  end;
end;

end.
Admin: Пользуемся тегами для оформления кода!
Ответить с цитированием