Problems with New Features of VB9

I have 2 problems concerning the new array initializers and nullable types:

Then I use array initializers VB says that a type is espected - so type inference doesn't work here?

Second, the nullable types aren't implemented yet? Or why I can't write e.g.:

Code Snippet
Dim d As Date?
Thanks. Ralf Ehlert
[446 byte] By [ralf_oop] at [2008-2-28]
# 1

Hi Ralf,

Type inference for arrays works, the syntax is Dim x = New Integer() {1, 2, 3}.

Nullable types will be in Beta2.

Hope that helps,

Jonathan

JonathanAneja-MSFT at 2007-9-26 > top of Msdn Tech,Visual Studio Orcas,Visual Basic Express Orcas...
# 2

Hello Jonathan,

thanks for your help, it works :-) I have something expacted like Dim arr = new() {1,2,3} similar to the C# version var arr = new[] {1,2,3}; I use both languages but I prefer VB, because it is more productive and in this case I would prefer a C# like syntax without typing the type - I think this would be productive but the VB-Syntax is somehow neat.

Can you give any information or blog entries what we can expect from Beta2?

Thanks.

ralf_oop at 2007-9-26 > top of Msdn Tech,Visual Studio Orcas,Visual Basic Express Orcas...
# 3

If you want to keep up with what's coming out for VB, watch the VB blogs at http://blogs.msdn.com/vbteam/. Also Paul Vick's http://www.panopticoncentral.net/ is a good source. I also try to keep up with what's coming up on my blog.

Jim Wooley

http://devauthority.com/blogs/jwooley

jwooley at 2007-9-26 > top of Msdn Tech,Visual Studio Orcas,Visual Basic Express Orcas...

Visual Studio Orcas

Site Classified