0 To in arrays..
Sat, Apr 9 2005 12:42
A new feature in Vb.NET 2005, requested by your's truely, is the ability to include the "0 To " in array declarations. Whe nI asked for this feature though, I aksed for it to be a project level switch, such that the "0 To " would always be included for you, and ideally be grey to symbolize you can't edit that part.
So the outcome would be code such as :
Dim myStrings(10) As String
would appear as:
Dim myStrings(0 To 10) As String
The beauty of this is folks automatically know the declaration is 0 to upper bound.
Now what got me blogging about this, is a recent article on migrating VBA to VB.NET on msdn. If you scroll down to the section on arrays, you'll see the author got it wrong and declared the array as if by count, not upperbound. Perhaps this visual helper would have helped them out a bit. it's sad to see people get such simple stuff wrong, and really does cry out that a fix is needed... Oh well, maybe in orcas ........