Click here to Skip to main content
15,885,767 members
Home / Discussions / C#
   

C#

 
GeneralRe: How to create the winform with code not by the guide (project-->add-->windows Form) at desgin-time in c#? Pin
mctramp1689-Jun-09 16:32
mctramp1689-Jun-09 16:32 
GeneralRe: How to create the winform with code not by the guide (project-->add-->windows Form) at desgin-time in c#? Pin
Christian Graus9-Jun-09 17:09
protectorChristian Graus9-Jun-09 17:09 
QuestionHow to cast to a type stored in a field Pin
redivider9-Jun-09 12:20
redivider9-Jun-09 12:20 
AnswerRe: How to cast to a type stored in a field Pin
Christian Graus9-Jun-09 12:40
protectorChristian Graus9-Jun-09 12:40 
AnswerRe: How to cast to a type stored in a field Pin
Nooner9-Jun-09 14:43
Nooner9-Jun-09 14:43 
AnswerRe: How to cast to a type stored in a field Pin
Thomas Weller9-Jun-09 16:08
Thomas Weller9-Jun-09 16:08 
GeneralRe: How to cast to a type stored in a field Pin
redivider10-Jun-09 6:49
redivider10-Jun-09 6:49 
QuestionLetter from Number generator Pin
Nooner9-Jun-09 11:17
Nooner9-Jun-09 11:17 
Hey I'm looking for a bit of help for a generic letter (see code below) Generator.

The funciton takes a number and returns a String.

expected:
input output
----- ------
1 a
26 z
27 aa
28 ab
52 az
53 ba
54 bb
78 bz
79 ca
702 aaa
703 aab
704 aac
...

Here is the code I got so far:
public String getLetter(int? number)
{
    number -= 1;
    String letter = "";
    char[] lettersA = {
                         'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i',
                         'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r',
                         's', 't', 'u', 'v', 'w', 'x', 'y', 'z'
                      };

    int size = number.Value % 26;
    int bigSize = number.Value % 676;
    int loop = (int)Math.Floor((decimal)(number.Value / 26));
    int bigLoop = (int)Math.Floor((decimal)(number.Value / 676));


    for (int i = 0; i < loop; i++)
    {
        letter += lettersA[i];
    }
    letter += lettersA[size];

    return letter;
}

Please respond if you have a solution.

Thank you,
Marc

Life is too short to program in Visual Basic.

AnswerRe: Letter from Number generator Pin
Christian Graus9-Jun-09 11:21
protectorChristian Graus9-Jun-09 11:21 
GeneralRe: Letter from Number generator Pin
Nooner9-Jun-09 13:25
Nooner9-Jun-09 13:25 
GeneralRe: Letter from Number generator Pin
Christian Graus9-Jun-09 14:27
protectorChristian Graus9-Jun-09 14:27 
QuestionConfig files Pin
CodingYoshi9-Jun-09 11:04
CodingYoshi9-Jun-09 11:04 
AnswerRe: Config files Pin
Christian Graus9-Jun-09 11:14
protectorChristian Graus9-Jun-09 11:14 
AnswerRe: Config files Pin
Dave Kreskowiak9-Jun-09 12:32
mveDave Kreskowiak9-Jun-09 12:32 
GeneralRe: Config files Pin
CodingYoshi9-Jun-09 17:22
CodingYoshi9-Jun-09 17:22 
GeneralRe: Config files Pin
CodingYoshi10-Jun-09 3:49
CodingYoshi10-Jun-09 3:49 
QuestionPrevious result of a method call is remembered. Is this related with JIT compiler? Pin
bin_bin19-Jun-09 10:31
bin_bin19-Jun-09 10:31 
AnswerRe: Previous result of a method call is remembered. Is this related with JIT compiler? Pin
Christian Graus9-Jun-09 10:43
protectorChristian Graus9-Jun-09 10:43 
GeneralRe: Previous result of a method call is remembered. Is this related with JIT compiler? Pin
bin_bin19-Jun-09 11:52
bin_bin19-Jun-09 11:52 
GeneralRe: Previous result of a method call is remembered. Is this related with JIT compiler? Pin
Christian Graus9-Jun-09 12:09
protectorChristian Graus9-Jun-09 12:09 
AnswerRe: Previous result of a method call is remembered. Is this related with JIT compiler? Pin
Dr.Walt Fair, PE9-Jun-09 11:58
professionalDr.Walt Fair, PE9-Jun-09 11:58 
QuestionSubmit a specific form in HTML page Pin
Fayu9-Jun-09 10:03
Fayu9-Jun-09 10:03 
Question3D point / 3 axis chart. Pin
amirbrb9-Jun-09 9:36
amirbrb9-Jun-09 9:36 
AnswerRe: 3D point / 3 axis chart. Pin
Seraph_summer9-Jun-09 10:24
Seraph_summer9-Jun-09 10:24 
GeneralRe: 3D point / 3 axis chart. Pin
amirbrb9-Jun-09 10:44
amirbrb9-Jun-09 10:44 

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.