I don't think so. Why would you want this behavior? Seems like it would
just be adding clutter to me.
> Or any block statement for that matter...
>
[quoted text clipped - 18 lines]
>
> possible in VS 2005 or 2008?
For code reading ease. At least a tool tip showing the "if" statement when
you hover over the "end if" statement would be nice.
> I don't think so. Why would you want this behavior? Seems like it would
> just be adding clutter to me.
[quoted text clipped - 21 lines]
> >
> > possible in VS 2005 or 2008?
Apart from the fact that it would help the code self-document itself, it's
for the case where the End If is not visible in the editing window at the
same time that the If is. This can sometimes be an issue with nested End If
blocks, where you might be down at the bottom of the code looking at two or
three End If statements stacked on top of one another without a clue as to
which one belongs to which bit of logic.
Before you respond that code blocks should be short enough that they fit on
one screen, it's just something that happens in the real world no matter how
good your intentions are.
I key them in by hand myself, somewhat like the OP's suggestion, but usually
insert a comment that describes the design, rather than just echoing the
expression in the If statement. The OP's suggestion could be a little
problematical for complex If expressions, so I'm not sure I'd go for his
proposal.
What I'd love, for the same reason the OP wants his comment, would be
something that would automatically insert a comment above the #End Region
statement that would echo what's in the text of the #Region statement, so
that something like:
#Region "Public properties"
#End Region
would come out something like:
#Region "Public properties"
' Public properties
#End Region
It's be even better if VB syntax would allow this:
#End Region "Public properties"
like C# does.
Tom Dacon
Dacon Software Consulting
>I don't think so. Why would you want this behavior? Seems like it would
>just be adding clutter to me.
[quoted text clipped - 21 lines]
>>
>> possible in VS 2005 or 2008?
Scott M. - 12 Apr 2008 17:02 GMT
I understand that nested If's can be troublesome and I understand what
happens in the real world. My opinion seems to be the same as yours (since
you agree that you aren't sure you'd go for the OP's desire to have the
whole If logic repeated in the comment).
I do what you do, which is to add a short comment to the End If, with some
descriptive text identifying which If this belongs to.
-Scott
> Apart from the fact that it would help the code self-document itself, it's
> for the case where the End If is not visible in the editing window at the
[quoted text clipped - 63 lines]
>>>
>>> possible in VS 2005 or 2008?