none
debugger less effective than old visual basic RRS feed

  • Question

  • If you select a group of variables, in old VB appeared the evaluated value.

    In visual studio, this happens only for singular variables.

    Is this correct?

    Thursday, March 19, 2020 3:49 PM

Answers

  • Hy Andrew,

    i mean this:

    x*y/2.45 for example. If you select it, nothing is evaluated.

    Sometimes, even on single variables it refuses to show the value.

    It is not a good feature. Visual basic 6.0 was much more useful in debugging.

    I don't remember how the VB6 IDE worked, but by my estimation there's nothing in your presented codeline for the IDE to grab onto for evaluation.

    z = ( ( x * y ) / 2.45 )

    In my code line example you should be able to hover on Z for the fully evaluated value.  You should be able to hover on any parenthesed operation group to view just that portion's evaluated value.

    I have seen VS kind of trip on itself when trying to show runtime evaluations of parenthesed groups like this.  If you hovered on the / for example it would sometimes show the value of x * y and sometimes the value of x * y / 2.45.  Similarly if you hovered on x * y it would sometimes show the correct evaluation but sometimes the full evaluation of the outer grouping (ie x * y / 2.45).

    This unpredictable behavior has been more of an irritant to me at runtime/debug mode.  I have never seen it not evaluate at all though.


    Before you can learn anything new you have to learn that there's stuff you don't know.

    Thursday, March 19, 2020 4:34 PM

All replies

  • I think by "group of variables" you mean arrays or lists?  If so then yes, if you hover your mouse over that at runtime, say with a breakpoint set, it should show the number of elements and it should have have a little + on the left hand side so you can expand to see each individually indexed value.

    That only works if the breakpoint is after or below the code point where the collection is populated.


    Before you can learn anything new you have to learn that there's stuff you don't know.

    Thursday, March 19, 2020 3:58 PM
  • Hy Andrew,

    i mean this:

    x*y/2.45 for example. If you select it, nothing is evaluated.

    Sometimes, even on single variables it refuses to show the value.

    It is not a good feature. Visual basic 6.0 was much more useful in debugging.

    Thursday, March 19, 2020 4:20 PM
  • Hello,

    Please check out using watch and quick watches coupled with then auto and local window in the IDE. Also DataTips's are another way by pinning them.

    DataTip example

    Watch window for out of local scope form level variables

    Locally scoped variables


    Please remember to mark the replies as answers if they help and unmarked them if they provide no help, this will help others who are looking for solutions to the same or similar problem. Contact via my Twitter (Karen Payne) or Facebook (Karen Payne) via my MSDN profile but will not answer coding question on either.

    NuGet BaseConnectionLibrary for database connections.

    StackOverFlow
    profile for Karen Payne on Stack Exchange

    Thursday, March 19, 2020 4:28 PM
    Moderator
  • Hy Andrew,

    i mean this:

    x*y/2.45 for example. If you select it, nothing is evaluated.

    Sometimes, even on single variables it refuses to show the value.

    It is not a good feature. Visual basic 6.0 was much more useful in debugging.

    I don't remember how the VB6 IDE worked, but by my estimation there's nothing in your presented codeline for the IDE to grab onto for evaluation.

    z = ( ( x * y ) / 2.45 )

    In my code line example you should be able to hover on Z for the fully evaluated value.  You should be able to hover on any parenthesed operation group to view just that portion's evaluated value.

    I have seen VS kind of trip on itself when trying to show runtime evaluations of parenthesed groups like this.  If you hovered on the / for example it would sometimes show the value of x * y and sometimes the value of x * y / 2.45.  Similarly if you hovered on x * y it would sometimes show the correct evaluation but sometimes the full evaluation of the outer grouping (ie x * y / 2.45).

    This unpredictable behavior has been more of an irritant to me at runtime/debug mode.  I have never seen it not evaluate at all though.


    Before you can learn anything new you have to learn that there's stuff you don't know.

    Thursday, March 19, 2020 4:34 PM
  • I've found.

    If you abandone the loop in wich the variable is used, it does not show the result.

    For example:

    fot i=0 to 100

           x=5*ì^2

    next i

    At the end of loop it does not show 100. Anyway it is a minor problem. Thanks Karen, i can use the window you are talking about.

    Thursday, March 19, 2020 4:43 PM
  • I've found.

    If you abandone the loop in wich the variable is used, it does not show the result.

    For example:

    fot i=0 to 100

           x=5*ì^2

    next i

    At the end of loop it does not show 100. Anyway it is a minor problem. Thanks Karen, i can use the window you are talking about.

    Try this.

    Private xVariable As Integer = 0
    Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
        For indexer As Integer = 0 To 100
    
            xVariable = CInt(5 * indexer ^ 2)
            Console.WriteLine($"{indexer,12} {xVariable}")
        Next indexer
    End Sub

    In the IDE output window the last output will show 100 50000.

    To validate this without Console.WriteLine you can set a conditional breakpoint I believe this started with VS2015, if not VS2017. The breakpoint is only hit if in this case indexer = 100 and the breakpoint can be disabled and re-enabled.


    Please remember to mark the replies as answers if they help and unmarked them if they provide no help, this will help others who are looking for solutions to the same or similar problem. Contact via my Twitter (Karen Payne) or Facebook (Karen Payne) via my MSDN profile but will not answer coding question on either.

    NuGet BaseConnectionLibrary for database connections.

    StackOverFlow
    profile for Karen Payne on Stack Exchange

    Thursday, March 19, 2020 5:11 PM
    Moderator