Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- unit Unit1;
- interface
- uses
- Windows, Messages, SysUtils, Variants, 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
- {$R *.dfm}
- type
- TFoo = class
- private
- FBar: string;
- public
- property Bar: string read FBar write FBar;
- end;
- procedure DoSomething(const AString: string; out AFoo: TFoo);
- begin
- AFoo.Bar := AFoo.Bar + AString;
- end;
- procedure TForm1.Button1Click(Sender: TObject);
- var
- LFoo: TFoo;
- begin
- LFoo := TFoo.Create();
- try
- LFoo.Bar := 'Hello World';
- // ShowMessage(LFoo.Bar);
- DoSomething('a', LFoo);
- // ShowMessage(LFoo.Bar);
- finally
- LFoo.Free();
- end;
- end;
- end.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement