highlighting question

  • Thread starter Thread starter amercer
  • Start date Start date
A

amercer

Guest
In VS, I enter the following VB code:

Dim x As Double = 1.9
Dim s As String = CStr(CInt(x))


CInt is highlighted down from blue (the color of CStr) to gray. I don't know the name of this feature, but I've seen it many times before when some fragment of your code is unnecessarily over qualified. I don't mind that at all. But in this case, with CInt gray, the implication is that you can remove it without changing semantics, and that is not true. The result of this code is different if I leave CInt in or remove it - you get integer or double formatting.

And by the way, I found VS online help to be singularly useless in chasing this down. I flat out could not find this feature documented anywhere. I browsed and searched for about 10 minutes and got nowhere. So I remain curious as to the name of this feature.

Continue reading...
 
Back
Top