473,473 Members | 1,833 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

console.writeline

Hi

I am using console.Writeline in my simple program. I do not however see
anything happening in the output window when I debug,

there are also no error messages,

Has anybody a tip on what I may be doing wrong,

thanks

portroe

Nov 20 '05 #1
5 11482
If you want to display something in the output window, you can try the
System.Diagnostics.Debug.WriteLine() method. I think the Console.WriteLine()
method is meant for Console applications (not Windows.Forms), althought it
works on my machine.

Is your test app. a Console or Windows.Forms application?

--
Greetz,
Jan
__________________________________
Read my weblog: http://weblogs.asp.net/jan
"portroe" <bo*@sleigh.com> schreef in bericht
news:uG**************@TK2MSFTNGP11.phx.gbl...
Hi

I am using console.Writeline in my simple program. I do not however see
anything happening in the output window when I debug,

there are also no error messages,

Has anybody a tip on what I may be doing wrong,

thanks

portroe

Nov 20 '05 #2
What kind of application are you writing? Windows Forms or command line?

Console.WriteLine outputs text to the command line when you are running a
Command Line (DOS like) program.

If you want to only output to the Output window within the IDE, Try:

Debug.WriteLine or
Trace.WriteLine

(Both are defined in the System.Diagnostics namespace)

Only use these for debugging puroses. If you are writing a command line
console app, use Console.WriteLine instead.

Hope This helps,

Trev.

"portroe" <bo*@sleigh.com> wrote in message
news:uG**************@TK2MSFTNGP11.phx.gbl...
Hi

I am using console.Writeline in my simple program. I do not however see
anything happening in the output window when I debug,

there are also no error messages,

Has anybody a tip on what I may be doing wrong,

thanks

portroe

Nov 20 '05 #3
* portroe <bo*@sleigh.com> scripsit:
I am using console.Writeline in my simple program. I do not however
see anything happening in the output window when I debug,


Use 'Debug.WriteLine' instead. Or create a project of type "Console
Application" (you can change the type of an application after creating
it in the project properties).

--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>
Nov 20 '05 #4
The Module1 code looks as follows, I have tried changing to debug but to
no avail,

thanks

portroe

Module Module1
Sub Main()
Dim myCar As SportsCar
myCar = New SportsCar()

'Set the horesepower and weight too..

myCar.HorsePower = 240
myCar.weight = 1085

'report the details...
Console.WriteLine("Horsepower:" & myCar.HorsePower)
Console.WriteLine("Weight" & myCar.weight)


'report the number of doors...
Console.WriteLine("The number of doors is:")
Console.WriteLine(mycar.Numberofdoors)

'try and change number of doors to 1000
mycar.Numberofdoors = 1000

'report the number of doors
Console.WriteLine("The number of doors is:")
Console.WriteLine(mycar.Numberofdoors)

'try change number of doors to 2
mycar.Numberofdoors = 2

'report the number of doors
Console.WriteLine("The number of doors is:")
Console.WriteLine(mycar.Numberofdoors)

'Report the speed
Console.WriteLine("The cars speed is:")
Console.WriteLine(mycar.Speed)

'accelerate
mycar.accelerate(5)

'Report the new speed
Console.WriteLine("The Car's speed is Now:")
Console.WriteLine(mycar.Speed)
'set the color property to "Red" ...
mycar.color = "Red"

'show what the value of the property is...
Console.WriteLine("My car is this color:")
Console.WriteLine(mycar.color)

'Display the details of the car...
DisplayCardetails(mycar)

'Wait...
Console.ReadLine()
End Sub
'Displaycardetails - function that displays a car details...
Function DisplayCardetails(ByVal myCar As Car)

'display the details of the car...
Console.WriteLine("Color:" & myCar.Color)
Console.WriteLine("Number of doors:" & mycar.numberofdoors)
Console.WriteLine("Current speed:" & myCar.Speed)
Console.WriteLine()

End Function
End Module
Herfried K. Wagner [MVP] wrote:
* portroe <bo*@sleigh.com> scripsit:
I am using console.Writeline in my simple program. I do not however
see anything happening in the output window when I debug,

Use 'Debug.WriteLine' instead. Or create a project of type "Console
Application" (you can change the type of an application after creating
it in the project properties).


Nov 20 '05 #5
* portroe <bo*@sleigh.com> scripsit:
The Module1 code looks as follows, I have tried changing to debug but
to no avail,


What's the type of the project? Are you sure 'Sub Main' is selected as
startup object in the project properties?

--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>
Nov 20 '05 #6

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

Similar topics

4
by: jabailo | last post by:
This is driving me crazy. I finally got the Remoting sample chat application working almost. When I run the chat client in VS.NET it goes into an endless loop -- that's because I assume that...
1
by: Oz | last post by:
This is long. Bear with me, as I will really go through all the convoluted stuff that shows there is a problem with streams (at least when used to redirect stdout). The basic idea is that my...
7
by: shawnk | last post by:
Hello Everyone How do you format format numbers right-justified using Console.WriteLine(), i.e I need to line up numbers in vertical columns and the MSDN documentation is pretty poor Here is the...
5
by: Publicjoe | last post by:
I am working on a little app which uses colour in the console window. I have created a class to extend the console functionality but the ClearScreen method does not work correctly. I am enclosing a...
17
by: MumboJumbo | last post by:
Hi I have a really basic question hopefully some can help me with: Can you write a (i.e. one) C# project that works from the cmd line and gui? I seems if i write a GUI app it can't write to...
4
by: Bob | last post by:
I just recently noticed that when I start my applicatoin in debug mode, the IDE hangs (no disk or CPU activity) indefinitely (at least 20 minutes). Pausing the application shows that it's hung up...
2
by: djc | last post by:
out of all the overloads that pop up via intellisense for console.writeline() the following one confuses me: Console.WriteLine (string format, params object arg) 1) whats the deal with...
1
by: John Wright | last post by:
I am running a console application that connects to an Access database (8 million rows) and converts it to a text file and then cleans and compacts the database. When it runs I get the following...
0
by: Stephen Thomas | last post by:
Hi there I wonder if any one has encountered this problem or can suggest what is wrong. I am trying the a procedure from the msn site but get the following message: Error 1 The type or...
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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,...
1
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...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.