Показать сообщение отдельно
  #5  
Старый 30.10.2008, 23:14
Drozh Drozh вне форума
Активный
 
Регистрация: 12.06.2008
Сообщения: 313
Репутация: 40
По умолчанию

Нипонимаю в чем проблема? Все работает идеально... Гляди первый Юнит
(специально оставил все)
Код:
unit Unit1;
interface
uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs;
const
 Const1 = 2345;
type
  Type1 = record
   i: integer;
   st: string;
  end;
  TForm1 = class(TForm)
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;
implementation
{$R *.dfm}
end.
И второй юнит
Код:
unit Unit2;
interface
uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, Unit1; // добавленный юнит
type
  TForm2 = class(TForm)
    procedure FormCreate(Sender: TObject);
  private
    { Private declarations }
  public
   D: Type1; // множно использовать здесь
    { Public declarations }
  end;
var
  Form2: TForm2;
  K: Type1; // здесь
implementation

{$R *.dfm}

procedure TForm2.FormCreate(Sender: TObject);
var
 A: Type1; // и здесь
 B: Integer;
begin
 B := Const1;
 A.i := B;
 A.st := 'Ы';

 K.i := 1222;
 K.st := A.st;
end;

end.
 
Ответить с цитированием