eugeneK
eugeneK

Reputation: 11116

Inline debugging in ASP.NET VB

i have an VB.NET application with few functions i need to debug (like ie. Assert in C#). Is it possible and how i do that ?

    Public Shared Function createNumberArrayList(ByVal startValue As Integer, _
                                             ByVal endValue As Integer, _
                                             Optional ByVal isBackwards As Boolean = False) As ArrayList
    Dim nArrayList As New ArrayList()
    If Not isBackwards Then
        For index As Integer = startValue To endValue
            nArrayList.Add(index)
        Next
    Else
        For index As Integer = endValue To startValue
            nArrayList.Add(index)
        Next
    End If
    Return nArrayList
End Function

Basically what i need is to enter few values and see if the function works and returns proper ArrayList.

Thanks

Upvotes: 0

Views: 333

Answers (1)

Meta-Knight
Meta-Knight

Reputation: 17845

Assert is not specific to C#, it's a framework method, so it can be used in any .NET language. You can do something like this:

Diagnostics.Debug.Assert(nArrayList.Count > 0)

Edit:

I'm not sure whether Debug.Assert works in ASP.NET applications or not, I found contradictory info on the web about this... If it doesn't work, check out this CodeProject article.

Upvotes: 1

Related Questions