Does C# have any equivalent for VB6
With
End With
C *= A is equivalent to C = C * A. /= Divide AND assignment operator. It divides the left operand with the right operand and assigns the result to the left operand. C /= A is equivalent to C = C / A.
+= Add AND assignment operator. It adds the right operand to the left operand and assign the result to the left operand. C += A is equivalent to C = C + A. -=
The Complete List of all 32 C Programming Keywords (With Examples) - Programiz.
Syntax errors are mistakes in the source code, such as spelling and punctuation errors, incorrect labels, and so on, which cause an error message to be generated by the compiler.
There's nothing quite equivalent, but C# 3 gained the ability to set properties on construction:
var person = new Person { Name = "Jon", Age = 34 };
And collections:
var people = new List<Person>
{
new Person { Name = "Jon" },
new Person { Name = "Holly"}
};
It's definitely not a replacement for all uses of With
, but worth knowing for some of them.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With