VB 2008 variable declaration statements

Dim i As Integer = 10 Dim j As System.Int32 = 20 Dim k As New Integer()

On a related note, you have also previewed the correct syntax to declare a Function using the syntax of VB 2008:

Function Add(ByVal x As Integer, ByVal y As Integer) As Integer

Return x + y End Function

While it is true that when you are comfortable with the syntax of your language of choice, you tend to intuitively know what constitutes a valid statement, there are two idioms of VB 2008 code statements that deserve special mention to the uninitiated.

Was this article helpful?

0 0

Post a comment