Re: String() declaration?



Michel,

With VB 2008 it is in my idea more and more

Dim temp() ={"hello","world"}

You probably don't agree this with me, but I have the meaning that as less you have to write and let done by the computer the better.

The effect is the same. It is a complete early binded array of strings.

Cor

"Michel Posseth" <msdn@xxxxxxxxxxx> wrote in message news:eVu$I1nOJHA.3748@xxxxxxxxxxxxxxxxxxxxxxx
Hello Anil ,

Dim temp() as String

is the classic VB syntax to declare an array

VB also supports

Dim temp as String()


This method is more intuitiv to programmers with a C background , this is also a big advantage for coders who both use C# and VB
in early versions of VB.Net ( 2002 and i guess 2003 i believe , but i am not sure ) there was a difference

Between the two the new method could not be used to declare and instantiate the array in one line

Dim temp() as String ={"hello","world"} worked but Dim temp as String()={"hello","world"} did not work in early versions

Nowadays in VB.Net 2005 and 2008 both work the same so it becomes a mather of taste wich one of the 2 you use
as you see the VB language also evolves in a forward kind of way :-)

I concur with Onur regarding his remark that you see more and more "Dim temp as String()"in code examples on the net


HTH

Michel Posseth [MCP]
http://www.vbdotnetcoder.com




"Anil Gupte/iCinema.com" <anil-list@xxxxxxxxxxx> schreef in bericht news:uAROveZOJHA.2100@xxxxxxxxxxxxxxxxxxxxxxx
Can someone please explan the difference between

Dim temp as String()

and

Dim temp() as String

in terms of syntax and practical usage? I thought I knew, but of late have become confused due to reasons too complicated to go in here.

Will appreciate your inputs.
--
Anil Gupte
www.keeninc.net
www.icinema.com
www.wizo.tv


.



Relevant Pages


Loading