1.定义单元
unit Unit2;
interface
const a:string='good';
implementation
end.
2.调用单元
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
StdCtrls;
type
TForm1 = class(TForm)
Button1: TButton;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
uses
unit2;
{$R *.DFM}
procedure TForm1.Button1Click(Sender: TObject);
begin
showmessage(a);
end;
end.