RE: Output Window



OK, that is probably it. I'm studying for Microsoft Exam and it instructs me
to create a console applicaiton for each Exercise, but I'm justing doing all
of it in one Windows Applicaiton instead to build on common project with all
my examples to review.

I suspect I should probably be using the Debug statement instead, right?

Thanks.

"Family Tree Mike" wrote:

I suspect your application is compiled as a windows application rather than a
console application. Do you need to run as a windows application?

"Greg" wrote:

I have used the Console.Clear method, but it gives me a "The Handle is
Invalid" error message. It doesn't appear in my ERROR window, so I'm not
understanding why this won't work. Any suggestions? I am using like in the
following lines of code.

Public Sub DirFiles()
Dim ourDir As System.IO.DirectoryInfo = New
System.IO.DirectoryInfo("C:\VBTEST")
Console.Clear()
Console.WriteLine("Directory: {0}", ourDir.FullName)
Dim myFile As System.IO.FileInfo
For Each myFile In ourDir.GetFiles
Console.WriteLine("File: {0}", myFile.FullName)
Next myFile
Console.WriteLine("Root: {0}", ourDir.Root)
End Sub

Do you see anything wrong that would cause the Console.Clear method not to
work?

Thanks, Greg
"kimiraikkonen" wrote:

Greg,
In this hello world console application, clear function clears "hello world"
line properly. Then you must look at your code again:

Module Module1

Sub Main()
Console.WriteLine("hello world")
Console.Clear()
' Pause
Console.ReadLine()

End Sub

End Module

HTH,

Onur

"Greg" wrote:

I am using the following command to output my results to the Output window
(for testing things out).

Console.WriteLine ("Output")

I'd like to clear the Output window of any previous output. I tried

Console.Clear

but, this results in an error.

Is there a way to clear previous output text in the Output Window?
.



Relevant Pages

  • RE: Output Window
    ... "Greg" wrote: ... to create a console applicaiton for each Exercise, ... I'd like to clear the Output window of any previous output. ... Is there a way to clear previous output text in the Output Window? ...
    (microsoft.public.dotnet.languages.vb)
  • Re: How to minimize command mode window in console program?
    ... to set some property to minimize the console window. ...     ByVal hWnd As IntPtr, ...     End Sub ...
    (microsoft.public.dotnet.languages.vb)
  • Re: How to minimize command mode window in console program?
    ... to set some property to minimize the console window. ... Sub Main ... you know) to invoke ShowWindow function API. ...
    (microsoft.public.dotnet.languages.vb)
  • RE: Output Window
    ... Public Sub DirFiles() ... Dim myFile As System.IO.FileInfo ... I'd like to clear the Output window of any previous output. ... Is there a way to clear previous output text in the Output Window? ...
    (microsoft.public.dotnet.languages.vb)
  • Re: Console.Clear()
    ... data to the console window. ... uinhandled exception and the exception is that it does not have the ... Sub Main ...
    (microsoft.public.dotnet.languages.vb)