Click here to Skip to main content
15,895,283 members
Home / Discussions / C#
   

C#

 
GeneralMonth name from integer Pin
Uncle Monkey2-Jul-03 23:43
Uncle Monkey2-Jul-03 23:43 
GeneralRe: Month name from integer Pin
GISnet3-Jul-03 2:24
GISnet3-Jul-03 2:24 
GeneralRe: Month name from integer Pin
Uncle Monkey3-Jul-03 2:35
Uncle Monkey3-Jul-03 2:35 
GeneralRe: Month name from integer Pin
Not Active3-Jul-03 2:55
mentorNot Active3-Jul-03 2:55 
GeneralRe: Month name from integer Pin
GISnet3-Jul-03 4:25
GISnet3-Jul-03 4:25 
GeneralRe: Month name from integer Pin
Jim Stewart3-Jul-03 6:49
Jim Stewart3-Jul-03 6:49 
GeneralRe: Month name from integer Pin
Daniel Turini3-Jul-03 15:50
Daniel Turini3-Jul-03 15:50 
GeneralRe: Month name from integer Pin
Jim Stewart3-Jul-03 18:15
Jim Stewart3-Jul-03 18:15 
I respectfully submit that the problem description did not indicate the need for internationalization. Therefore my modest contribution met the initial requirements.

Since the bar has been raised, I will attempt to satisfy.

One solution might go thus:
public enum Mois 
{
	Janvier = 1, 
	Février, 
	Mars, 
	Avril, 
	Peut, 
	Juin, 
	Juillet, 
	Août, 
	Septembre, 
	Octobre, 
	Novembre, 
	Décembre 
};
[STAThread]
static void Main(string[] args)
{
	for (Mois mois = Mois.Janvier; mois <= Mois.Décembre; mois++)
	{
		Console.WriteLine (mois.ToString ());
	}
}

I suspect that this is not what was intended. So to blend my previous solution with Monsieur Nischalke:
public enum Months 
{	
	January, 	
	February, 	
	March, 	
	April, 
	May, 	
	June, 	
	July, 	
	August, 	
	September, 	
	October, 	
	November, 	
	December
};
[STAThread]
static void Main(string[] args)
{
	DateTimeFormatInfo dtfi = new DateTimeFormatInfo ();
	for (Months month = Months.January; month <= Months.December; month++)
	{
		Console.WriteLine (dtfi.MonthNames[(int)month]);
	}
}

This has the benefit of symbolic constants instead of literals with the internationalization.

α.γεεκ

Fortune passes everywhere.
Duke Leto Atreides


GeneralRe: Month name from integer Pin
Not Active3-Jul-03 18:56
mentorNot Active3-Jul-03 18:56 
GeneralRe: Month name from integer Pin
Jim Stewart3-Jul-03 18:59
Jim Stewart3-Jul-03 18:59 
GeneralRe: Month name from integer Pin
Not Active4-Jul-03 3:40
mentorNot Active4-Jul-03 3:40 
GeneralRe: Month name from integer Pin
Jim Stewart4-Jul-03 5:04
Jim Stewart4-Jul-03 5:04 
GeneralC# Zip component Pin
Martin Hart Turner2-Jul-03 20:37
Martin Hart Turner2-Jul-03 20:37 
GeneralRe: C# Zip component Pin
James T. Johnson2-Jul-03 23:22
James T. Johnson2-Jul-03 23:22 
GeneralRe: C# Zip component Pin
Martin Hart Turner3-Jul-03 0:05
Martin Hart Turner3-Jul-03 0:05 
Generalc# equivalent of delay() in c/c++ Pin
Asim N.2-Jul-03 14:47
Asim N.2-Jul-03 14:47 
GeneralRe: c# equivalent of delay() in c/c++ Pin
Kannan Kalyanaraman2-Jul-03 16:18
Kannan Kalyanaraman2-Jul-03 16:18 
GeneralRe: c# equivalent of delay() in c/c++ Pin
dynamic2-Jul-03 21:31
dynamic2-Jul-03 21:31 
GeneralRe: c# equivalent of delay() in c/c++ Pin
Asim N.2-Jul-03 22:42
Asim N.2-Jul-03 22:42 
GeneralRe: c# equivalent of delay() in c/c++ Pin
dynamic2-Jul-03 23:08
dynamic2-Jul-03 23:08 
GeneralC# install wizard ?!! Pin
Eng.hany2-Jul-03 14:28
Eng.hany2-Jul-03 14:28 
GeneralRe: C# install wizard ?!! Pin
Kannan Kalyanaraman2-Jul-03 16:10
Kannan Kalyanaraman2-Jul-03 16:10 
GeneralRe: C# install wizard ?!! Pin
Heath Stewart2-Jul-03 18:42
protectorHeath Stewart2-Jul-03 18:42 
GeneralRe: C# install wizard ?!! Pin
Kannan Kalyanaraman2-Jul-03 18:56
Kannan Kalyanaraman2-Jul-03 18:56 
GeneralRe: C# install wizard ?!! Pin
apferreira3-Jul-03 4:06
apferreira3-Jul-03 4:06 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.