I wanted to use structures in a dictionary so that my key can contain more values
so i did something like this
Public Structure Classes
'Declare data members
Public room As Integer
Public day As Integer
Public timeslot As Single
End Structure
Sub main()
Dim room_bookings As New Dictionary(Of Classes, String)
Dim a As New Classes()
a.room = 1
a.day = 10
a.timeslot = 4
room_bookings.Add(a, "DVB2454 ")
i had no problem doing the room booking for DVB 2454
but i am having problem printing out the oiuput
i thought this would work '
For Each pair As KeyValuePair(Of Classes, String) In room_bookings
Console.WriteLine(pair.Key.day + pair.Key.room + pair.Key.timeslot, pair.Value)
Next
Console.Read()
but it doesn`t
This post has been edited by AdamSpeight2008: 01 November 2012 - 11:09 AM

New Topic/Question
Reply




MultiQuote




|