473,390 Members | 1,034 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,390 software developers and data experts.

writing own debug messages to debug window

Sorry for all who think this is easy, I was not able to handle this

Coming from VB6 where with simple

debug.print strAString

you could write to debug window, I am totalling failing in vb.net 2003
The sample in the help file does not work. I tried now for days ...

Pls could anybody post a sample, including necessary imports and so on -
thank you so much in advance
Nov 20 '05 #1
7 18769
Hi Thomas

Debug.WriteLine(strAString)

The string will appear in the Output window, as opposed to the command
window as it does in VB6.

HTH

Charles
"Thomas Pecha" <th**********@firstinex.at> wrote in message
news:O4**************@TK2MSFTNGP10.phx.gbl...
Sorry for all who think this is easy, I was not able to handle this

Coming from VB6 where with simple

debug.print strAString

you could write to debug window, I am totalling failing in vb.net 2003
The sample in the help file does not work. I tried now for days ...

Pls could anybody post a sample, including necessary imports and so on -
thank you so much in advance

Nov 20 '05 #2
TNX, but did not work
does this also work if I do a PPC App

The help says :

Public Shared Function Main(args() As String) As Integer
Debug.Listeners.Add(New TextWriterTraceListener(Console.Out))
Debug.AutoFlush = True
Debug.Indent()
Debug.WriteLine("Entering Main")
Console.WriteLine("Hello World.")
Debug.WriteLine("Exiting Main")
Debug.Unindent()
Return 0
End Function 'Main

but then I get a build error because TextWriterTraceListener is not known (I
imported diagnostics)

big ???? here - sorry

"Charles Law" <bl**@thingummy.com> schrieb im Newsbeitrag
news:uI**************@TK2MSFTNGP10.phx.gbl...
Hi Thomas

Debug.WriteLine(strAString)

The string will appear in the Output window, as opposed to the command
window as it does in VB6.

HTH

Charles
"Thomas Pecha" <th**********@firstinex.at> wrote in message
news:O4**************@TK2MSFTNGP10.phx.gbl...
Sorry for all who think this is easy, I was not able to handle this

Coming from VB6 where with simple

debug.print strAString

you could write to debug window, I am totalling failing in vb.net 2003
The sample in the help file does not work. I tried now for days ...

Pls could anybody post a sample, including necessary imports and so on -
thank you so much in advance


Nov 20 '05 #3
Thomas,
As Charles stated, Print is now Write & WriteLine in VB.NET

Debug.Write(strAString)
Debug.WriteLine(strAString)

In addition to the Debug class, there is also a Trace Class. Normally calls
to the Debug class are removed during release builds, while calls to the
Trace class are available in both Debug & Release builds.

In addition to Write & WriteLine both classes have: WriteIf, WriteLineIf,
Indent, Unindent, Assert, and Fail methods. Which allow for a richer
formatting of the output.

Oh! Write, WriteLine, WriteIf, and WriteLineIf support giving a category,
which is useful to label your output.

Debug.WriteLine(strAString, "strAString")
Debug.WriteLine(index, "index")

Trace.WriteLine(strAString, "strAString")
Trace.WriteLine(index, "index")

Hope this helps
Jay

"Thomas Pecha" <th**********@firstinex.at> wrote in message
news:O4**************@TK2MSFTNGP10.phx.gbl...
Sorry for all who think this is easy, I was not able to handle this

Coming from VB6 where with simple

debug.print strAString

you could write to debug window, I am totalling failing in vb.net 2003
The sample in the help file does not work. I tried now for days ...

Pls could anybody post a sample, including necessary imports and so on -
thank you so much in advance

Nov 20 '05 #4
I'm sorry, I don't know what you mean by a PPC App. Do you mean a console
application? If so, I have just created a new console app and added a single
line to main:

Module Module1
Sub Main()
Debug.WriteLine("Hello world")
End Sub
End Module

It compiles and runs, and outputs Hello world to the Output window. Is that
what you are after?

Charles
"Thomas Pecha" <th**********@firstinex.at> wrote in message
news:%2***************@TK2MSFTNGP11.phx.gbl...
TNX, but did not work
does this also work if I do a PPC App

The help says :

Public Shared Function Main(args() As String) As Integer
Debug.Listeners.Add(New TextWriterTraceListener(Console.Out))
Debug.AutoFlush = True
Debug.Indent()
Debug.WriteLine("Entering Main")
Console.WriteLine("Hello World.")
Debug.WriteLine("Exiting Main")
Debug.Unindent()
Return 0
End Function 'Main

but then I get a build error because TextWriterTraceListener is not known (I imported diagnostics)

big ???? here - sorry

"Charles Law" <bl**@thingummy.com> schrieb im Newsbeitrag
news:uI**************@TK2MSFTNGP10.phx.gbl...
Hi Thomas

Debug.WriteLine(strAString)

The string will appear in the Output window, as opposed to the command
window as it does in VB6.

HTH

Charles
"Thomas Pecha" <th**********@firstinex.at> wrote in message
news:O4**************@TK2MSFTNGP10.phx.gbl...
Sorry for all who think this is easy, I was not able to handle this

Coming from VB6 where with simple

debug.print strAString

you could write to debug window, I am totalling failing in vb.net 2003
The sample in the help file does not work. I tried now for days ...

Pls could anybody post a sample, including necessary imports and so on - thank you so much in advance



Nov 20 '05 #5
Thomas,
What kind of app are you building? A .NET Compact Framework app?

TextWriterTraceListener is not supported on the .NET Compact Framework.

When looking at help, check the "Requirements - Platforms" section at the
bottom of the page.

Remove that line along with the Indent & Unindent and your app 'should'
work. Again check the help for what classes & members are supported on which
platform.

Hope this helps
Jay

"Thomas Pecha" <th**********@firstinex.at> wrote in message
news:%2***************@TK2MSFTNGP11.phx.gbl...
TNX, but did not work
does this also work if I do a PPC App

The help says :

Public Shared Function Main(args() As String) As Integer
Debug.Listeners.Add(New TextWriterTraceListener(Console.Out))
Debug.AutoFlush = True
Debug.Indent()
Debug.WriteLine("Entering Main")
Console.WriteLine("Hello World.")
Debug.WriteLine("Exiting Main")
Debug.Unindent()
Return 0
End Function 'Main

but then I get a build error because TextWriterTraceListener is not known (I imported diagnostics)

big ???? here - sorry

"Charles Law" <bl**@thingummy.com> schrieb im Newsbeitrag
news:uI**************@TK2MSFTNGP10.phx.gbl...
Hi Thomas

Debug.WriteLine(strAString)

The string will appear in the Output window, as opposed to the command
window as it does in VB6.

HTH

Charles
"Thomas Pecha" <th**********@firstinex.at> wrote in message
news:O4**************@TK2MSFTNGP10.phx.gbl...
Sorry for all who think this is easy, I was not able to handle this

Coming from VB6 where with simple

debug.print strAString

you could write to debug window, I am totalling failing in vb.net 2003
The sample in the help file does not work. I tried now for days ...

Pls could anybody post a sample, including necessary imports and so on - thank you so much in advance



Nov 20 '05 #6
"Thomas Pecha" <th**********@firstinex.at> schrieb:
Coming from VB6 where with simple

debug.print strAString

you could write to debug window, I am totalling failing in vb.net 2003
The sample in the help file does not work. I tried now for days ...


Use 'System.Diagnostics.Debug.WriteLine' instead.

--
Herfried K. Wagner
MVP VB Classic, VB.NET
http://www.mvps.org/dotnet
Nov 20 '05 #7
Nope.
"Thomas Pecha" <th**********@firstinex.at> wrote in message
news:%2***************@TK2MSFTNGP11.phx.gbl...
TNX, but did not work
does this also work if I do a PPC App

The help says :

Public Shared Function Main(args() As String) As Integer
Debug.Listeners.Add(New TextWriterTraceListener(Console.Out))
Debug.AutoFlush = True
Debug.Indent()
Debug.WriteLine("Entering Main")
Console.WriteLine("Hello World.")
Debug.WriteLine("Exiting Main")
Debug.Unindent()
Return 0
End Function 'Main

but then I get a build error because TextWriterTraceListener is not known (I imported diagnostics)

big ???? here - sorry

"Charles Law" <bl**@thingummy.com> schrieb im Newsbeitrag
news:uI**************@TK2MSFTNGP10.phx.gbl...
Hi Thomas

Debug.WriteLine(strAString)

The string will appear in the Output window, as opposed to the command
window as it does in VB6.

HTH

Charles
"Thomas Pecha" <th**********@firstinex.at> wrote in message
news:O4**************@TK2MSFTNGP10.phx.gbl...
Sorry for all who think this is easy, I was not able to handle this

Coming from VB6 where with simple

debug.print strAString

you could write to debug window, I am totalling failing in vb.net 2003
The sample in the help file does not work. I tried now for days ...

Pls could anybody post a sample, including necessary imports and so on - thank you so much in advance



Nov 20 '05 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: news frontiernet.net | last post by:
I have key entered and tried to run example 4-6 from Dany Goodmans DYNAMIC HTML book, version one that is on pages 94-96. This is part of my effort to learn JavaScript. I checked each byte and...
2
by: Dennis M. Marks | last post by:
I have an existing page that dynamically creates data in a popup window. I am trying to change it to use an iFrame. Is the following code valid: The iFrame is as follows <iframe...
10
by: ion | last post by:
Hi! Is there a way to write messages to the javascript console? Like a debug.write() method? Thanks! Ion
2
by: Kevin | last post by:
Hi All, Can someone please tell me what the difference is between DEBUG and TRACE. From what I can see, they are two different classes, but with the same members? Whats the purpose of have two...
0
by: High and dRy | last post by:
Print debug messages at the beginning of all the methods with the method name and the argument values and at the end with the return values. Is it possible to do the in C# without writing debug...
10
by: Brett | last post by:
For some reason when I step into the code below, it jumps out on the second iteration at the line I have marked below. Nothing else happens - no errors. Dim tcpClient As New...
46
by: Ian Boyd | last post by:
IIS5, on a Windows 2000 Server machine. Debeg.WriteLine "Hello, world!" How can i view it?
2
by: Bob S | last post by:
I am using Debug.WriteLine and Trace.WriteLine to output messages from a dll. This dll is used in an application. No matter whether i run the program in release mode or debug mode and whether i...
2
by: joelkeepup | last post by:
Hi, I made a change this morning and now im getting an error that says either "a is undefined or null" or "e is undefined or null" the microsoft ajax line is below, I have no idea how to...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.