473,729 Members | 2,099 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

console.writeli ne

Hi

I am using console.Writeli ne 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 11508
If you want to display something in the output window, you can try the
System.Diagnost ics.Debug.Write Line() method. I think the Console.WriteLi ne()
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******** ******@TK2MSFTN GP11.phx.gbl...
Hi

I am using console.Writeli ne 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.WriteLi ne 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.Diagnost ics namespace)

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

Hope This helps,

Trev.

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

I am using console.Writeli ne 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.Writeli ne in my simple program. I do not however
see anything happening in the output window when I debug,


Use 'Debug.WriteLin e' 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.HorsePowe r = 240
myCar.weight = 1085

'report the details...
Console.WriteLi ne("Horsepower: " & myCar.HorsePowe r)
Console.WriteLi ne("Weight" & myCar.weight)


'report the number of doors...
Console.WriteLi ne("The number of doors is:")
Console.WriteLi ne(mycar.Number ofdoors)

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

'report the number of doors
Console.WriteLi ne("The number of doors is:")
Console.WriteLi ne(mycar.Number ofdoors)

'try change number of doors to 2
mycar.Numberofd oors = 2

'report the number of doors
Console.WriteLi ne("The number of doors is:")
Console.WriteLi ne(mycar.Number ofdoors)

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

'accelerate
mycar.accelerat e(5)

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

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

'Display the details of the car...
DisplayCardetai ls(mycar)

'Wait...
Console.ReadLin e()
End Sub
'Displaycardeta ils - function that displays a car details...
Function DisplayCardetai ls(ByVal myCar As Car)

'display the details of the car...
Console.WriteLi ne("Color:" & myCar.Color)
Console.WriteLi ne("Number of doors:" & mycar.numberofd oors)
Console.WriteLi ne("Current speed:" & myCar.Speed)
Console.WriteLi ne()

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

Use 'Debug.WriteLin e' 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
2225
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 there is now way for me to interface to a Console.ReadLine(). However, when I run it in the cmd window, it does not output any Console.WriteLine()s ( even the "Hello" that I put as the first
1
5385
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 application (VB.NET) will start a process, redirect its stdout and capture that process' output, displaying it in a window. I've written a component for this, and a test application for the component. It allows me to specify a command to execute,...
7
6358
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 problem double percent_00_01 = 1D / 10000D double percent_00_10 = 1D / 1000D double percent_01_00 = 1D / 100D double percent_10_00 = 10D / 100D
5
6341
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 complete project to show what happens. If anybody has an idea of how to fix this, please let me know. Yes I am aware that this is all in .Net 2. Thanks in advance.
17
4233
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 console using System.Console.WriteLine if thge project has its "Output Type" to "Windows Application". However I can write to stdio if i set output type to "Console Application". When I do this I unfortunately get a "console box" as well
4
2979
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 at a line in a referenced assembly, one of my own, which is a simple Console.WriteLine() statement. The stack trace shows this line one level under the current frame, which is displayed as . Anyone seen this behavior before, know what causes it?...
2
2954
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 'params' there? I am used to this pattern: type var, type var, type var etc... like: string str, int i, double x. This console.writeline overload says 'params object arg' ? 2) I noticed that the console.writeline( string, object, object, object,
1
2039
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 error: The CLR has been unable to transition from COM context 0x1a2008 to COM context 0x1a2178 for 60 seconds. The thread that owns the destination context/apartment is most likely either doing a non pumping wait or processing a very long...
0
2063
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 namespace name 'LiveSearch' does not exist in the namespace 'ConsoleSampleWebSearch' (are you missing an assembly reference?) C:\Documents and Settings\Compaq\Local Settings\Application Data\Temporary Projects\ConsoleSampleWebSearch\Program.cs 13 30...
0
8927
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8764
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9289
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9156
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8159
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6722
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4534
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4798
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
2694
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.