Console application question

  • Thread starter Thread starter Chris Leffer
  • Start date Start date
C

Chris Leffer

Hi.

I am playing a bit with console applications. I have a very simple Main
routine to show some text on the console:

Module Module1

Public Sub Main()
Console.WriteLine("Hello world")
End Sub

End Module

When I run the project, the DOS window opens and close automatically. I
can only see the message if I set a breakpoint on the code. Is it
possible to keep the DOS window open without a breakpoint?

Regards,

Chris Leffer
 
Hello,

Chris Leffer said:
I am playing a bit with console applications. I have a very
simple Main routine to show some text on the console: [...]
When I run the project, the DOS window opens and close
automatically. I can only see the message if I set a breakpoint on
the code. Is it possible to keep the DOS window open without a
breakpoint?

Add a call to 'Console.Read'. Notice that the console is _not_ a DOS
window!
 
Hi Chris.
You have to go to command window (Is the execute textbox type "COMMAND" +
[Enter]),
browse to the sub directory where the .exe are, and execute the .exe using
command instruction, like

c:\My projects> Module1.exe [Enter]


regards

Carlos Barini
(e-mail address removed)
Brasil
 
Hi Herfried.

Your suggestion did the trick. And thanks for the clarification about
the console window :-)

Could you tell me what Console.Read does exactly? It seems some kind of
wait state.

Regards,

Chris Leffer
 
Back
Top