with TOpenDialog Create Self do begin Execute Free end with TOpenDialo

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
// 1
with TOpenDialog.Create(Self) do
begin
Execute;
Free;
end;
// 2
with TOpenDialog.Create(Self) do
try
Execute;
finally
Free;
end;