R
RSH
I have two HashTables (_CompanyDeductions,_CompanyAccruals) that contain
several objects each. I am trying to loop through and print the properties
of the objects in the Hashtables:
I am trying to creat a dynamic function that will print all of the
properties of each of the objects stored in the the HashTable. I can't seem
to get at the properties of the objects.
Thanks for any help!
Ron
This does NOT work:
Public Sub Print(ByVal type As String)
Console.WriteLine(vbCrLf)
Dim al As New Hashtable
Dim o As Object
Console.WriteLine("CompanyId:" & _CompanyID & " CompanyName:" &
_CompanyName)
Select Case Type
Case "Deductions"
al = _CompanyDeductions
Case "Accruals"
al = _CompanyAccruals
End Select
If al.Count > 0 Then
Console.WriteLine(type & " ID" & vbTab & type & " Name" & vbTab & " Rate")
Console.WriteLine("---------------------------------------")
For Each o In al
Console.WriteLine("{0} : {1}", o.value.Name)
Next
Else
Console.WriteLine("No " & type & " exist for this company")
End If
End Sub
several objects each. I am trying to loop through and print the properties
of the objects in the Hashtables:
I am trying to creat a dynamic function that will print all of the
properties of each of the objects stored in the the HashTable. I can't seem
to get at the properties of the objects.
Thanks for any help!
Ron
This does NOT work:
Public Sub Print(ByVal type As String)
Console.WriteLine(vbCrLf)
Dim al As New Hashtable
Dim o As Object
Console.WriteLine("CompanyId:" & _CompanyID & " CompanyName:" &
_CompanyName)
Select Case Type
Case "Deductions"
al = _CompanyDeductions
Case "Accruals"
al = _CompanyAccruals
End Select
If al.Count > 0 Then
Console.WriteLine(type & " ID" & vbTab & type & " Name" & vbTab & " Rate")
Console.WriteLine("---------------------------------------")
For Each o In al
Console.WriteLine("{0} : {1}", o.value.Name)
Next
Else
Console.WriteLine("No " & type & " exist for this company")
End If
End Sub