O'Reilly logo

Visual Basic® .NET by Example by Bob Donald, Gabriel Oancea

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Stepping through Code

The modern debuggers (normally integrated with the IDE) are much better than this. As you will see shortly, they will allow you to step through your program (execute one statement at a time) and look at the values of variables. Also the debugger will allow you to set breakpoints, which are statements in your programs that you mark and tell the debugger to suspend program execution when it gets there, so that you can have a look at what is happening. Let's try an example. Create a new console project and enter the code as shown:

 Module Module1 Sub Main() Dim a() As Integer = {1, 6, 6, 9} Dim s As String = "The array has " s += CStr(Count6es(a)) s += " elements that have a value of 6" Console.Out.WriteLine(s) End Sub ' This ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required