I'm currently using VS2008 and VB.NET.
When I attempt to populate a Queue that has not been instantiated with objects, the program simply hangs without throwing an error.
I have run into this issue multiple times in different parts of the program in the past few days.
What could be the cause of this?
Here's the code:
Structure ConsoleBufferLine
Public EntryDate As Date
Public Text As String
Public Sub New(ByVal textLine As String)
Text = textLine
EntryDate = DateTime.Now
End Sub
End Structure
The code that causes a hang:
Private Buffer As Queue(Of ConsoleBufferLine)
Buffer.Enqueue(New ConsoleBufferLine("-"))
vs
Private Buffer As NEW Queue(Of ConsoleBufferLine)
Buffer.Enqueue(New ConsoleBufferLine("-"))
EDIT: When I make a new project and type in the following code, it also fails to throw an exception. However, when I put a try-catch around it, the exception is then caught.
Public Class Form1
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim S As New SortedList(Of String, String)
S.Add("lol", "value")
S.Add("lol", "value")
End Sub
End Class