From: mp on
I'm working on some elearning courses from MS
i'm such a beginner i don't even know how to test the sample codes
create a new windows app, new console app, new class library?
lessons never tell a beginner the basic stuff - they always assume more
knowlege than i have
:-)

in this example it writes to the console
but when i run it, the dos prompt window flashes open and closes too fast to
read.
how to keep it open or where else to see the results of console.writeline
i don't see it in immediate window nor in output window.
even if i start a dosprompt before running this code the lines don't print
to that console, the other one still flashes open and closes immediately

here's the entire sample from elearning
Dim sFrame As StackFrame = New StackFrame(0, True)

' Display the flne name in execution

Console.WriteLine(" File: {0}", sFrame.GetFileName)



it doesn't say how to test it, but I started a new project in vb dotnet 2008
express - new console app

in module1.vb i pasted the code inside sub main

Module Module1

Sub Main()

Dim sFrame As StackFrame = New StackFrame(0, True)

' Display the flne name in execution

Console.WriteLine(" File: {0}", sFrame.GetFileName)



End Sub

End Module



then i hit debug-startdebugging

and the console window flashes (but it's behind the vis studio window - i
can see a corner of it only)



what am i missing?

thanks

mark




From: Onur Güzel on
On Jun 20, 5:54 pm, "mp" <nos...(a)Thanks.com> wrote:
> I'm working on some elearning courses from MS
> i'm such a beginner i don't even know how to test the sample codes
> create a new windows app, new console app, new class library?
> lessons never tell a beginner the basic stuff - they always assume more
> knowlege than i have
> :-)
>
> in this example it writes to the console
> but when i run it, the dos prompt window flashes open and closes too fast to
> read.
> how to keep it open or where else to see the results of console.writeline
> i don't see it in immediate window nor in output window.
> even if i start a dosprompt before running this code the lines don't print
> to that console, the other one still flashes open and closes immediately
>
> here's the entire sample from elearning
> Dim sFrame As StackFrame = New StackFrame(0, True)
>
> ' Display the flne name in execution
>
> Console.WriteLine(" File: {0}", sFrame.GetFileName)
>
> it doesn't say how to test it, but I started a new project in vb dotnet 2008
> express - new console app
>
> in module1.vb i pasted the code inside sub main
>
> Module Module1
>
> Sub Main()
>
> Dim sFrame As StackFrame = New StackFrame(0, True)
>
> ' Display the flne name in execution
>
> Console.WriteLine(" File: {0}", sFrame.GetFileName)
>
> End Sub
>
> End Module
>
> then i hit debug-startdebugging
>
> and the console window flashes (but it's behind the vis studio window - i
> can see a corner of it only)
>
> what am i missing?
>
> thanks
>
> mark

Just put "Console.ReadLine" just before "End Sub" of main sub.

HTH,

Onur Güzel
From: mp on

"Onur G�zel" <kimiraikkonen85(a)gmail.com> wrote in message
news:2ab2e822-0acf-4256-9d36-b35b3eda043c(a)u7g2000yqm.googlegroups.com...
On Jun 20, 5:54 pm, "mp" <nos...(a)Thanks.com> wrote:
> I'm working on some elearning courses from MS
snip>
> what am i missing?
>
> thanks
>
> mark

Just put "Console.ReadLine" just before "End Sub" of main sub.

HTH,

Onur G�zel

thanks, so if i see console.writeline in a sample it is correct i want to
start a new console app in order to see that activity? it wont' show in any
of the debug windows inside the vbnet experss ide, correct?
thanks
mark


From: Onur Güzel on
On Jun 20, 7:02 pm, "mp" <nos...(a)Thanks.com> wrote:
> "Onur G zel" <kimiraikkone...(a)gmail.com> wrote in message
>
> news:2ab2e822-0acf-4256-9d36-b35b3eda043c(a)u7g2000yqm.googlegroups.com...
> On Jun 20, 5:54 pm, "mp" <nos...(a)Thanks.com> wrote:
>
> > I'm working on some elearning courses from MS
> snip>
> > what am i missing?
>
> > thanks
>
> > mark
>
> Just put "Console.ReadLine" just before "End Sub" of main sub.
>
> HTH,
>
> Onur G zel
>
> thanks, so if i see console.writeline in a sample it is correct i want to
> start a new console app in order to see that activity?  it wont' show in any
> of the debug windows inside the vbnet experss ide, correct?
> thanks
> mark

Couldn't understand what you meant. At runtime, you need
"Console.Readline" or "Console.Read" in order to pause the execution
until a user input arrives. Thus, you can see all the activity out
there on console window, and in IDE, using Immediate/Debug window, if
you call Debug.WriteLine rather than Console.WriteLine, you won't need
something like "Console.Read/Readline" to see what's going on, as all
the activity is recorded in Immediate window in Express editions.

HTH,

Onur Güzel
From: mp on

"Onur G�zel" <kimiraikkonen85(a)gmail.com> wrote in message
news:d00e93cc-0cf4-4d9e-a47e-e8ad1f45ccec(a)j8g2000yqd.googlegroups.com...
On Jun 20, 7:02 pm, "mp" <nos...(a)Thanks.com> wrote:
> "Onur G zel" <kimiraikkone...(a)gmail.com> wrote in message
>
> news:2ab2e822-0acf-4256-9d36-b35b3eda043c(a)u7g2000yqm.googlegroups.com...
> On Jun 20, 5:54 pm, "mp" <nos...(a)Thanks.com> wrote:
>
> > I'm working on some elearning courses from MS
> snip>
> > what am i missing?
>
> > thanks
>
> > mark
>
> Just put "Console.ReadLine" just before "End Sub" of main sub.
>
> HTH,
>
> Onur G zel
>
> thanks, so if i see console.writeline in a sample it is correct i want to
> start a new console app in order to see that activity? it wont' show in
> any
> of the debug windows inside the vbnet experss ide, correct?
> thanks
> mark

Couldn't understand what you meant. At runtime, you need
"Console.Readline" or "Console.Read" in order to pause the execution
until a user input arrives. Thus, you can see all the activity out
there on console window, and in IDE, using Immediate/Debug window, if
you call Debug.WriteLine rather than Console.WriteLine, you won't need
something like "Console.Read/Readline" to see what's going on, as all
the activity is recorded in Immediate window in Express editions.

HTH,

Onur G�zel

thanks that clarifies it...
what i meant was
1
if i see console.writeline in a sample
in order to paste the sample code into a project to test it,
i start a new console app project as opposed to a new windows forms app or
new class library or other project types...
i guess in a console app there 's just one sub main and if i hit start
debugging button that runs the app
i guess i could also create a windows form app and put a command button on
the form to call sub main and that would also run the app?

2
output of console.writeline only goes to console window and not to any of
the builtin debug windows in the ide - you clarified that that is correct,
thanks