Hi...i'm just wondering what does debug.writeline does in a code?...can anyone explain it?...i've read from msdn but can't seem to understand..anyone can put it in a much simpler format?
Printable View
Hi...i'm just wondering what does debug.writeline does in a code?...can anyone explain it?...i've read from msdn but can't seem to understand..anyone can put it in a much simpler format?
Simple answer is that it does the same thing as debug.print in VB6. So for example if you have the following piece of code
when you run this in the IDE if you look in the output window you will see 'value is 42' printed out. It can be useful to see what the value of variables etc are in different parts of your program but with the nice tooltips in vb.net its also quite easy to see these values when you step through the program.Code:
Dim intInteger As Int16
intInteger = 42
Debug.WriteLine("value is " & intInteger)
This is the simplest format i could put this in so hope it helps or explains.
basilisk is right. If I may add that you can also use DebugView to watch the output of Debug.WriteLine() statements when you run the code outside the Visual Studio IDE. This works only with debug builds though.