VB 10 thoughts (part 4)
Posted
Tue, Oct 9 2007 14:01
by
bill
still teasing out thoughts from the cobwebs
- Date literals
today in VB you can only specify date literals in the format of #MM/dd/yyyy#
That's incredibly USA centric. I'd like to input date literals in the form of dd/MM/yyyy, but because that would cause an ambiguity, I'd really like to see dd MMM yyyy, or failing that the ISO 8601 standard format of yyyy-MM-dd and yyyy-MM-ddThh:mm:ss
- select case object
I've been asking for this one for so long I forgot about it till I read the comments on Paul's blog.
Ideally in the format of :
Select Case sender Is
Case TextBox1
....
Case TextBox2
....
similarly
Select Case TypeOf(sender) Is
Case TextBox
....
Case Label
....
- Catches in Using blocks
Again this is one that I had forgotten about.
Using aDisopable As .....
Catch Ex As Exception
End Using
- Calling partial methods
VB 9 gives us partial methods, but the partial method itself has to be empty. It would be nice if there was a default method generated which you could still use, similar to the capabilities or Overrides but without the inheritance need. I thought the use OverWrite could be used, e.g:
'generated code
Overwriteable Sub Foo()
Dosomething()
End Sub
'user code
Overwrite Sub Foo()
DosomethingElse()
Overwriten()'calls the generated overwriteable method
End Sub