473,396 Members | 1,773 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

With feature Csharp

VB6 had a nifty feature where you could use the keyword 'With' in a block for
an object and then you did not have to name the object inside the block.
something like

With onjOne
.Row = -1
.Col = 1
End With

Is there a similar feature in csharp?
cheers!
Nov 17 '05 #1
3 1136
Tantr Mantr wrote:
[cut]
With onjOne
.Row = -1
.Col = 1
End With

Is there a similar feature in csharp?
cheers!


This article may help you:
http://www.gotdotnet.com/team/csharp.../ask.aspx#with

Cheers,
--
Antonio Cangiano
Administrator of www.visualcsharp.it
Nov 17 '05 #2
No, there is not, and Anders Hejlsberg, the senior C# designer,
believes that "With" makes code harder to read, not easier, so there is
unlikely to be a C# equivalent.

Nov 17 '05 #3
<"=?Utf-8?B?VGFudHIgTWFudHI=?=" <Tantr
Ma***@discussions.microsoft.com>> wrote:
VB6 had a nifty feature where you could use the keyword 'With' in a block for
an object and then you did not have to name the object inside the block.
something like

With onjOne
.Row = -1
.Col = 1
End With

Is there a similar feature in csharp?


No.

See http://www.pobox.com/~skeet/csharp/faq/#vb.with

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too
Nov 17 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
by: NilsNilsson | last post by:
I wrote this: short s1 = 0; short s2 = 1; short s3 = s1 + s2; And gor this compile error message: Cannot implicitly convert type 'int' to 'short' What is wrong here?
7
by: Timothy Shih | last post by:
Hi, I am trying to figure out how to use unmanaged code using P/Invoke. I wrote a simple function which takes in 2 buffers (one a byte buffer, one a char buffer) and copies the contents of the byte...
32
by: Zeljko | last post by:
Hi, I moved from VB6 to C# recently, and am very satisfied with the result. However, I miss this one feature. The closest thing I could find is "using" statement, but it requires object to...
0
by: Lee Alexander | last post by:
This isn't a CSharp language issue as such but this seemed the best place to put this :-) When compiling a CSharp application via DevStudio I want the IDE to still be responsive like when...
10
by: BBFrost | last post by:
We just recently moved one of our major c# apps from VS Net 2002 to VS Net 2003. At first things were looking ok, now problems are starting to appear. So far ... (1) ...
12
by: anna | last post by:
Map, generate, and maintain 50% of your .NET application code, namely your business and data objects. Use these objects in ASP.NET, Windows Forms, console or services applications. Business and...
6
by: Davie | last post by:
I want to authorise a user of a web service by using the AuthHeaderValue for some reason I keep getting a null reference exception when I try to run the following code: It seems to work fine on a...
14
by: cody | last post by:
I got a similar idea a couple of months ago, but now this one will require no change to the clr, is relatively easy to implement and would be a great addition to C# 3.0 :) so here we go.. To...
37
by: Ian Semmel | last post by:
If I have Enum en { i1, i2, i3 } I reckon I should be able to have
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.