VB 11 Tutorial 4: Getting Started
If you have not yet learnt about Numeric Values Please refer to Tutorial 3: Here
Today we will be working with Arrays.
First of all how can we declare a Array?
Code:
' Example in using Arrays.
Module SubNew
Sub Main()
' Arrays Start at 0
Dim ListOfNames() As String = New String() {"Samuel","Tom","Bob","Tim"} ' There is 4 items in this Array, with a upper bound of 3
Dim ListOfPhoneNumbers(3) As String = Nothing
ListOfPhoneNumbers(0) = "##########"
ListOfPhoneNumbers(1) = "##########"
ListOfPhoneNumbers(2) = "##########"
ListOfPhoneNumbers(3) = "##########"
Dim ListOfPets() As String = Split("Fluffy,Whity,Smokey,Bully", ",")
End Sub
End Sub
Today we will be working with Arrays.
First of all how can we declare a Array?
Code:
' Example in using Arrays.
Module SubNew
Sub Main()
' Arrays Start at 0
Dim ListOfNames() As String = New String() {"Samuel","Tom","Bob","Tim"} ' There is 4 items in this Array, with a upper bound of 3
Dim ListOfPhoneNumbers(3) As String = Nothing
ListOfPhoneNumbers(0) = "##########"
ListOfPhoneNumbers(1) = "##########"
ListOfPhoneNumbers(2) = "##########"
ListOfPhoneNumbers(3) = "##########"
Dim ListOfPets() As String = Split("Fluffy,Whity,Smokey,Bully", ",")
End Sub
End Sub
No comments:
Post a Comment