What's wrong with the VB With / End With keyword?

In this question, the user commented to never use block C in VB. Why?

+3
source share
5 answers

"Never" is a strong word.

I think this is normal if you do not abuse it (e.g. nesting)

IMHO is better:

With MyCommand.Parameters
    .Count = 1
    .Item(0).ParameterName = "@baz"
    .Item(0).Value = fuz
End With

than:

MyCommand.Parameters.Count = 1
MyCommand.Parameters.Item(0).ParameterName = "@baz"
MyCommand.Parameters.Item(0).Value = fuz
+15
source

With. , , .
Delphi , , VB.NET, , Delphi, .
, , With, C *, , , / , .

+4

.

, . , With (With + End With lines).

. IDE, , (, , ). . .

, , .

. :
with() #, VB.NET?

+1

here Verity Stob, : . ,

. ...

!

0

Source: https://habr.com/ru/post/1703207/


All Articles