Rudy Velthuis (TeamB) submitted this idea :
> Brad White wrote: > >> IMHO, the C# 'using' was put in place to make >> up for the lack in functionality that Delphi >> already had. > > Such as? AFAICT, Delphi only has try-finally, which C# also has.
The reason that we have to use 'using' in C# is to make finalization deterministic. Everything is guaranteed to be cleaned up when it leaves the scope. http://msdn.microsoft.com/en-us/library/yh598w02%28VS.80%29.aspx
In Delphi that is called Free. Or, if you are using interfaces, := nil.
HTH, Brad.