Structure Employee
Dim strName As String
Dim intSalary As Integer
End Structure
public class Test
public Shared Sub Main
Dim aryEmployees(15) As Employee
Dim intCounter As Integer
aryEmployees(0).strName = "J"
aryEmployees(0).intSalary = 3
aryEmployees(1).strName = "B"
aryEmployees(1).intSalary = 6
'Set other array elements here.
aryEmployees(15).strName = "P"
aryEmployees(15).intSalary = 1
'Show the elements of the array.
For intCounter = 0 To 15
Console.WriteLine("Array element: " & intCounter & vbCrLf & _
"Name: " & aryEmployees(intCounter).strName & vbCrLf & _
"Salary: " & aryEmployees(intCounter).intSalary)
Next intCounter
End Sub
End class
|