Re: Simple program not producing output
- From: garyusenet@xxxxxxxxx
- Date: 30 Nov 2006 04:05:03 -0800
Hi Stephany,
I find the F1 key too verbose, I have learnt all i know so far from
asking people in these forums and reading the ECMA specification (which
isn't half as verbose as the F1).
Stephany Young wrote:
Gary!
I just followed your steps 1 through 5 and this is what I got:
<loading of various assemblies snipped>
The thread 0x7a8 has exited with code 0 (0x0).
The thread 0x974 has exited with code 0 (0x0).
'WindowsApplication8.vshost.exe' (Managed): Loaded
'D:\MBS\WindowsApplication8\bin\Debug\WindowsApplication8.exe', Symbols
loaded.
myAL
Count: 3
Capacity: 4
Values: Hello World !
The thread 0xe4 has exited with code 0 (0x0).
The thread 0x470 has exited with code 0 (0x0).
The program '[1564] WindowsApplication8.vshost.exe: Managed' has exited
with code 0 (0x0).
Did you bother to look in the output window after you pressed F5. If not
then where did you expect the output to be displayed? You have deleted the
form that the wizard nicely created for you and there is no console. If you
insist in doing it this way then go to the Application tab of the project
Properties and change the Output Type to 'Console Application'. Then when
you run the exe from a command prompt you will see the output.
If you had created a new Console Application project in the first place you
would not have had this 'problem'.
Again I'm going to sound crabby, but please don't treat these newsgoups as
your primary help resource.
YOUR PRIMARY HELP RESOURCE IS ALWAYS THE F1 KEY!!!!!!!!!
<garyusenet@xxxxxxxxx> wrote in message
news:1164886256.196939.264410@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Hi.
I am trying to learn about array lists, and found an example on MSDN. I
tried to compile it but it's not producing any output. I can't see why.
Any ideas?
Here is what I did.
1. Started new windows application.
2. Deleted the code files (program.cs, form.cs)
3. Created a new code file.
4. Pasted the MSDN code into this code file.
5. Pressed F5. Nothing happened, no errors nothing.
6. Chose Build from the explorer pane.
7. When to a command shell, located the exe.
8. Run the exe, and i just got a blank line and returned to command
prompt.
Here is the code, why is it behaving like this? : -
using System;
using System.Collections;
public class SamplesArrayList
{
public static void Main()
{
// Creates and initializes a new ArrayList.
ArrayList myAL = new ArrayList();
myAL.Add("Hello");
myAL.Add("World");
myAL.Add("!");
// Displays the properties and values of the ArrayList.
Console.WriteLine("myAL");
Console.WriteLine(" Count: {0}", myAL.Count);
Console.WriteLine(" Capacity: {0}", myAL.Capacity);
Console.Write(" Values:");
PrintValues(myAL);
}
public static void PrintValues(IEnumerable myList)
{
foreach (Object obj in myList)
Console.Write(" {0}", obj);
Console.WriteLine();
}
}
/*
This code produces output similar to the following:
myAL
Count: 3
Capacity: f
Values: Hello World !
*/
thankyou,
Gary.
.
- Follow-Ups:
- Re: Simple program not producing output
- From: Stephany Young
- Re: Simple program not producing output
- References:
- Simple program not producing output
- From: garyusenet
- Re: Simple program not producing output
- From: Stephany Young
- Simple program not producing output
- Prev by Date: Re: Static function
- Next by Date: Re: System.IO.File.IsBinary() ?
- Previous by thread: Re: Simple program not producing output
- Next by thread: Re: Simple program not producing output
- Index(es):
Relevant Pages
|