The VB equivalent is a try/finally block

using(Foo f = new Foo())
{
        // ...
} // Dispose is called here

VB Equivalent
Dim f as Foo 'Foo must support IDisposable
Try
        ' ...
Finally
        f.Dispose
End Finally
        
Ron Jacobs
Program Manager
XML Enterprise Services


-----Original Message-----
From: Mathieu Rachlin [mailto:[EMAIL PROTECTED]] 
Sent: Wednesday, May 01, 2002 1:59 PM
To: [EMAIL PROTECTED]
Subject: Re: [DOTNET] From C# to VB.NET

Hi there,

Oh wow, I had never come across the "using statement" versus the "using
directive".

I did a quick search and came across this... Perhaps this will assist
you:[1]

I think that is a C#-only feature.

- Mat


[1]
http://www.gotdotnet.com/team/libraries/whitepapers%5Cresourcemanagement
%5Cresourcemanagement.htm

-----Original Message-----
From: Joel Mueller [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, May 01, 2002 4:52 PM
To: [EMAIL PROTECTED]
Subject: Re: [DOTNET] From C# to VB.NET


There isn't one, as far as I know.

> -----Original Message-----
> From: dotnet discussion [mailto:[EMAIL PROTECTED]]
> On Behalf Of Henrik Enemark Rasmussen
> Sent: Wednesday, May 01, 2002 3:40 PM
> To: [EMAIL PROTECTED]
> Subject: [DOTNET] From C# to VB.NET
>
>
> Hello All
>
> What is the VB.NET equivalent to the C# 'using' statement
> (not the 'using'
> directive) ?
>
> Regards
> Henrik
>
> You can read messages from the DOTNET archive, unsubscribe
> from DOTNET, or subscribe to other DevelopMentor lists at
> http://discuss.develop.com.
>
>

You can read messages from the DOTNET archive, unsubscribe from DOTNET,
or
subscribe to other DevelopMentor lists at http://discuss.develop.com.

You can read messages from the DOTNET archive, unsubscribe from DOTNET,
or
subscribe to other DevelopMentor lists at http://discuss.develop.com.

You can read messages from the DOTNET archive, unsubscribe from DOTNET, or
subscribe to other DevelopMentor lists at http://discuss.develop.com.

Reply via email to