pendragon Posted January 6, 2004 Posted January 6, 2004 In VB.NET you have the With... End With Statement I was just wondering if there is something similar in C# Thanks Quote
*Experts* Bucky Posted January 6, 2004 *Experts* Posted January 6, 2004 Nope, sorry. Quote "Being grown up isn't half as fun as growing up These are the best days of our lives" -The Ataris, In This Diary
pendragon Posted January 6, 2004 Author Posted January 6, 2004 O'Well just have to write it all in long hand. Thanks for the Reply Bucky. Quote
dragon4spy Posted January 7, 2004 Posted January 7, 2004 I have heard that using With...End With, the framework will only create the instance of object only once within the With statement. A lot of people recommended to use With...End With. Quote Don't judge a man by his look. Don't judge a book by its cover. :D
*Experts* Bucky Posted January 7, 2004 *Experts* Posted January 7, 2004 Yes, this is true. It will save time and resources by loading the object just once, especially if you are setting and accessing multiple properties. This was also true of VB6. Unfortunately, this is one mighty handy feature that C# lacks. Quote "Being grown up isn't half as fun as growing up These are the best days of our lives" -The Ataris, In This Diary
dragon4spy Posted January 7, 2004 Posted January 7, 2004 How about C++ and C++.net? Do they have With statement like vb? I wish they had one. :D Quote Don't judge a man by his look. Don't judge a book by its cover. :D
*Experts* Bucky Posted January 7, 2004 *Experts* Posted January 7, 2004 Since C# is based on C++, if C++ had the statement then C# definitely would. So again, the answer's no. Quote "Being grown up isn't half as fun as growing up These are the best days of our lives" -The Ataris, In This Diary
dragon4spy Posted January 7, 2004 Posted January 7, 2004 So, is there any way to reduce resources by loading the object just once in c++? :) Just answer YES or NO would appreciated, cos i have learnt only 1/10 of c++. Quote Don't judge a man by his look. Don't judge a book by its cover. :D
dragon4spy Posted January 7, 2004 Posted January 7, 2004 Your answer may motivate me to learn c++ language if it has something big more than vb. Quote Don't judge a man by his look. Don't judge a book by its cover. :D
*Experts* Bucky Posted January 7, 2004 *Experts* Posted January 7, 2004 As far as I know, no. But if anyone can disprove me, please go right ahead. Quote "Being grown up isn't half as fun as growing up These are the best days of our lives" -The Ataris, In This Diary
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.