Variants, Scope and Unassigned
Is it neccessary to set OLE variants to unassigned or are they
automatically set when going out of scope?
procedure Test;
var
DBEngine: Variant;
Workspace: Variant;
begin
DBEngine := CreateOLEObject('DAO.DBEngine');
try
Workspace := DBEngine.Workspaces[0];
try
Workspace.abc;
Workspace.xyz;
finally
Workspace := Unassigned; { <---- is this necessary }
end;
finally
DBEngine := Unassigned; { <---- is this necessary }
end;
end;
TIA
______________________________
Tim Parker-Nance
Orion Software
PO Box 27126, Greenacres
Port Elizabeth, 6057
South Africa
Tel: ++27 (0)41 311506
Fax: ++27 (0)41 351961
Cell: ++27 (0)82 6592897
Email: rpear...@aztec.co.za