Geeks With Blogs
Brian Schroer Don't Call Me Mort!

D'Arcy from Winnipeg wishes C# had a “with” statement.

Me, too. I've moved from VB6 to C# and am glad of it, but I really miss the old VB With/EndWith.

It's great for "chatty" interfaces, expecially the ability to nest With's to update "grandchild" properties:

With myCustomer
    .FirstName = "Phillip"
    .LastName = "Fry"
    .MiddleInitial = "J"
    .Age = 1024
    With .Address
       .AddressLine1 = "3000 Farnsworth Avenue"
       .City = "New New York City"
       .State = "NY"
       .Zip = "101010001100011"
       .Country = "USA"
       .Galaxy = "Milky Way"
    End With
End With

Posted on Tuesday, February 7, 2006 9:23 AM .NET | Back to top

Comments on this post: o/" When you with upon a thtar... o/"

No comments posted yet.
Your comment:
 (will show your gravatar)

Copyright © Brian Schroer | Powered by: