# Code help



## Devious Bane (Oct 8, 2008)

Im using C# for this coding.

The code is used to display certain input and output responses. The problem is, the output response I have for picture display causes a malfunction.
I specified the code as an "if" statement. Saying if this is selected then do this.
First, the racevar(Race variable I have defined) is functional with the code and it works...Unless nothing is selected, then the compiler doesnt even know if anything is selected.
This also happens when another variable, gendervar(Gender Variable I have defined), is in the same position.
I have provided a small fix by starting the program with default selections. The thing is, if someone deselected and ran the functions, it crashes.

So how can I find a way to define this condition(When the list is unselected) so I can tell the application what to do if this is the case?


----------



## Pi (Oct 8, 2008)

Devious Bane said:


> Im using C# for this coding.
> 
> The code is used to display certain input and output responses. The problem is, the output response I have for picture display causes a malfunction.
> I specified the code as an "if" statement. Saying if this is selected then do this.
> ...



please fix my car, it is green and doesn't start. when i put red paint on it it sort of works.


----------



## Ty Vulpine (Oct 9, 2008)

Don't pay attention to Pi. He is about as helpful as a screen door on a sub.


----------



## LizardKing (Oct 9, 2008)

TyVulpine said:


> Don't pay attention to Pi. He is about as helpful as a screen door on a sub.




Which, coincidentally, is about as helpful as the initial post.

OP: POST TEH CODEZ


----------



## Eevee (Oct 9, 2008)

don't pay attention to Ty; he likes to stalk Pi and post in the same threads about how unhelpful he is


----------



## Devious Bane (Oct 9, 2008)

On topic anyone?
Edit: I can't post the codes as of now considering all my connection ports are broken.
I will get that up possibly Monday since I can't find any means of accessing the code until then.


----------



## Takun (Oct 9, 2008)

Eevee said:


> don't pay attention to Ty; he likes to stalk Pi and post in the same threads about how unhelpful he is



Don't listen to Eevee, he likes to point out the obvious and is always right.

Well ummmm nevermind, you should probably listen to Eevee.


----------



## Ty Vulpine (Oct 9, 2008)

Eevee said:


> don't pay attention to Ty; he likes to stalk Pi and post in the same threads about how unhelpful he is



I got an infraction for my post, now I'll bet the Admin will look the other way and Eevee will not get even a warning...


----------



## SnowFox (Oct 9, 2008)

Pi said:


> please fix my car, it is green and doesn't start. when i put red paint on it it sort of works.



LOL



TyVulpine said:


> Don't pay attention to Pi. He is about as helpful as a screen door on a sub.



I think you and Pi are secretly in love with each other, or perhaps you just don't know it yet



Devious Bane said:


> Im using C# for this coding.
> 
> The code is used to display certain input and output responses. The problem is, the output response I have for picture display causes a malfunction...................



maybe you would be better off asking that question somewhere like here?

sorry to butt in


----------



## Ty Vulpine (Oct 9, 2008)

SnowFox said:


> I think you and Pi are secretly in love with each other, or perhaps you just don't know it yet



O.O I honestly don't have any legitimate response to that...


----------



## Aden (Oct 9, 2008)

TyVulpine said:


> I really don't care anymore.



Cool. Stop posting about it.


----------



## Pi (Oct 9, 2008)

Devious Bane said:


> On topic anyone?
> Edit: I can't post the codes as of now considering all my connection ports are broken.
> I will get that up possibly Monday since I can't find any means of accessing the code until then.



Yeah, if you want people to fix your code, a vague description of what you think is wrong with it is not useful at all.


----------



## Devious Bane (Oct 9, 2008)

Pi said:


> Yeah, if you want people to fix your code, a vague description of what you think is wrong with it is not useful at all.


Yeah, but when does anyone telling others to not care about other people have to do with this topic?
Just don't reply, I'll get the code when I can get access to it.


----------



## eb7w5yfe (Oct 11, 2008)

More details would be good, as others have said.

However, based on your extremely vague description of the problem, I'm going to guess that you want to check if the values are equal to null.  You say that the program crashes when nothing is selected; are you getting a null pointer exception?  (Or whatever the C# equivalent is; null reference or null object or something.)


----------



## Eevee (Oct 11, 2008)

http://www.catb.org/~esr/faqs/smart-questions.html

OP: don't post again until you've read this


----------



## Pi (Oct 12, 2008)

Eevee said:


> OP: don't post again



fixed


----------



## Devious Bane (Oct 14, 2008)

I have the code:

* private void Form1_Load(object sender, EventArgs e)
        {
            richTextBox1.AppendText("(C) The Devious Bane, 2008.");
            listBox2.SetSelected(0, true);//Preset
            listBox1.SetSelected(0, true);//Preset

        }


        private void button2_Click(object sender, EventArgs e)
        {
            //define variables
            String namevar = richTextBox9.Text;
            String codenamevar = richTextBox7.Text;
            String agevar = richTextBox5.Text;
            String racevar2 = richTextBox11.Text;
            ListBox gendervar = listBox2;
            ListBox racevar = listBox1;
                //Condistions
                richTextBox1.AppendText("\n\nName: " + namevar + "\nCodename: " + codenamevar + "\nAge: " + agevar + "\nGender: " + gendervar.SelectedItem + "\nRace: " + racevar.SelectedItem + "\n\nNotices:");
                if (racevar.SelectedItem.Equals("Other"))//Erroring code
                {
                    richTextBox1.AppendText("\nSpecified Race as '" + racevar2 + ".'");
                }
                if (gendervar.SelectedItem.Equals("N/A"))//Erroring code
                {
                    richTextBox1.AppendText("\nError: Please specify a Gender.");
                }
                if (racevar.SelectedItem.Equals("N/A"))//Erroring code
                {
                    richTextBox1.AppendText("\nError: Please specify a Race.");
                }
                if (racevar.SelectedItem.Equals("Reptilian") == false)//Erroring code
                {
                    pictureBox1.Load("Noimage.png");
                }

                if (racevar.SelectedItem.Equals("Reptilian") == true)//Erroring code
                {

                    if (gendervar.SelectedItem.Equals("Male") == true)//Erroring code
                    {
                        pictureBox1.Load("Rogers.png");
                    }
                    if (gendervar.SelectedItem.Equals("Female") == true)//Erroring code
                    {
                        pictureBox1.Load("Noimage.png");
                    }
                    if (gendervar.SelectedItem.Equals("N/A"))//Erroring code
                    {
                        pictureBox1.Load("Noimage.png");
                    }
                }

                if (racevar.SelectedItem.Equals("Reptilian") == false)//Erroring code
                    {
                    pictureBox1.Load("Noimage.png");
                    }

        }*

Areas marked with a "//" state comments.

Like I said, its the "if" statements that are messing up when something is not selected. That why I made the preset codes.


----------



## Pi (Oct 14, 2008)

this would be a lot more useful if you formatted it using the "code" bbcode instead of bold.

also did you never learn about &&, || and "else"???


----------



## nrr (Oct 14, 2008)

did sum1 jsut haek my gibsno??????


----------



## LizardKing (Oct 14, 2008)

> String namevar = *richTextBox9*.Text;
> String codenamevar = *richTextBox7*.Text;
> String agevar = *richTextBox5*.Text;
> String racevar2 = *richTextBox11*.Text;
> ...


This is where I started crying.

Variable names: KindaworkableIguess
Control names: omg kill me ;_;

Edit: Wait wait wait the last two are ListBoxes? But ListBox1/2 is already a listbox, and and... Aaaarrrgghhh.....


----------



## Devious Bane (Oct 14, 2008)

LizardKing said:


> This is where I started crying.
> 
> Variable names: KindaworkableIguess
> Control names: omg kill me ;_;
> ...


This is why I take a class for coding.

I redefined them, I didn't have to do that. Extra code.

Edit:
Okay restating more details with a screen:
Link





Now image is the gender and race boxes if one of them were unselected. I get what I think was called a "NullReference" error. So when I changed the coding to where it equals "null," don't run this, it still crashes like it can't tell if its null or not.


----------



## eb7w5yfe (Oct 15, 2008)

Checking for null should prevent it from crashing.  You haven't posted that code, so I can only take another stab in the dark: if you're doing "gendervar.SelectedItem.Equals("null")", that's not right.  Try "gendervar.SelectedItem == null" instead.  Think about what those two statements actually mean.  Which parts are objects, which are methods, and which are strings?  (Technically they may all be objects, but hopefully you know what I'm getting at here.)  What is it that becomes null when nothing is selected?


----------



## Devious Bane (Oct 15, 2008)

eb7w5yfe said:


> Checking for null should prevent it from crashing.  You haven't posted that code, so I can only take another stab in the dark: if you're doing _"gendervar.SelectedItem.Equals("null")_", that's not right.*  Try "gendervar.SelectedItem == null"* instead.  Think about what those two statements actually mean.  Which parts are objects, which are methods, and which are strings?  (Technically they may all be objects, but hopefully you know what I'm getting at here.)  What is it that becomes null when nothing is selected?


Bold: I did this as an "if" statement but it failed to pick up the problem and it crashed.
Italic: I will possibly try this, I have my doubts that it will work.

Nothing becomes "Null," It points to an "if" statement with a NullReference note and the program is crashed. This is debugging by the way.


----------



## eb7w5yfe (Oct 16, 2008)

Something is obviously becoming null if your program is crashing with a null reference exception.  If you post your code with the null checking if statement here, we might be able to give you more details.

Here, I'll give you an example based on some of what you posted:

```
if (racevar.SelectedItem.Equals("Other"))//Erroring code
```
If you get a null reference exception at this line, it means that either "racevar" is null, or more likely, "racevar.SelectedItem" is null.  

This error occurs because a null reference obviously cannot have any methods or properties.  So if "racevar" is null and you try to access the "SelectedItem" property, you'll get a null reference exception.  Likewise, if "racevar" is good but "SelectedItem" is null (which can occur when the list box doesn't have anything selected), trying to access the "racevar.SelectedItem.Equals" method will throw a null reference exception.


----------



## Eevee (Oct 17, 2008)

why are you using Equals() anyway

is C# really so bass-ackwards that it can't do a string comparison using comparison operators


----------



## Xenofur (Oct 17, 2008)

1. You cannot copyright characters, unless you have created enough visual works using the character to make at least a few million $ in net profit. So stop claiming that shit.

2. The copyright character is Â©. Using (c) just means you have no fucking idea what you're doing.


----------



## nrr (Oct 17, 2008)

Xenofur said:


> 1. You cannot copyright characters, unless you have created enough visual works using the character to make at least a few million $ in net profit. So stop claiming that shit.
> 
> 2. The copyright character is Â©. Using (c) just means you have no fucking idea what you're doing.


*[size=+2]Quoted for truth.[/size]*


----------



## Devious Bane (Oct 17, 2008)

Xenofur said:


> 1. You cannot copyright characters, unless you have created enough visual works using the character to make at least a few million $ in net profit. So stop claiming that shit.
> 
> 2. The copyright character is Â©. Using (c) just means you have no fucking idea what you're doing.


1: It basically means, I made it. I drew the pictures, I own them.

2: That would be nice if that was a key on my keyboard. Secondly, this is by no means complete, its a freaking test. It's just for trying out ideas, not to publish.

I haven't cussed/swore at you, I expect the same consideration. There is no reason to get your boiler fired. If so, don't reply until you can control your mouth.



eb7w5yfe said:


> Something is obviously becoming null if your program is crashing with a null reference exception. If you post your code with the null checking if statement here, we might be able to give you more details.
> 
> Here, I'll give you an example based on some of what you posted:
> 
> ...



If I knew how to properly define it, it would be fixed. I think the error is in logic, which the compiler can't mark as an error.



Eevee said:


> why are you using Equals() anyway
> 
> is C# really so bass-ackwards that it can't do a string comparison using comparison operators


Its to be specific on what needs to be hit for it to run its part. I can't say it equals that box's items, I must tell it what exactly what item for what I want it to do.
In the case of "Equals("N/A");" Since its the first in the list, I can change the "N/A" part to "0."
Considering computers count from 0, not 1.


----------



## Pi (Oct 17, 2008)

Devious Bane said:


> 1: It basically means, I made it. I drew the pictures, I own them.


No, it doesn't. You have no idea what you're fucking doing.



> 2: That would be nice if that was a key on my keyboard. Secondly, this is by no means complete, its a freaking test. It's just for trying out ideas, not to publish.



You don't know how to type characters that aren't on your keyboard? You really do have no idea what you're fucking doing. Â©â„¢ 



> I haven't cussed/swore at you, I expect the same consideration. There is no reason to get your boiler fired. If so, don't reply until you can control your mouth.


Å¿Ã¦Ã§k yoÃ¼


----------



## Devious Bane (Oct 17, 2008)

eb7w5yfe said:


> Å¿Ã¦Ã§k yoÃ¼


Clearly, you need to watch what you say.
I'm not following your attempt to start a flame battle.

Reported and will an admin/mod please lock this thread? Almost no one is aiding to the cause, I'm not even going to bother.


----------



## SnowFox (Oct 17, 2008)

Â© is alt + 0169 if that's any help


----------



## Pi (Oct 17, 2008)

Devious Bane said:


> Clearly, you need to watch what you say.
> I'm not following your attempt to start a flame battle.
> 
> Reported and will an admin/mod please lock this thread? Almost no one is aiding to the cause, I'm not even going to bother.



hahahaha


----------



## Ty Vulpine (Oct 17, 2008)

Devious Bane said:


> Clearly, you need to watch what you say.
> I'm not following your attempt to start a flame battle.
> 
> Reported and will an admin/mod please lock this thread? Almost no one is aiding to the cause, I'm not even going to bother.



Unfortunately, most of the people here in Bits & Bytes are some of the most unhelpful people on the internet. They prefer to bash rather than help.


----------



## Devious Bane (Oct 17, 2008)

TyVulpine said:


> Unfortunately, most of the people here in Bits & Bytes are some of the most unhelpful people on the internet. They prefer to bash rather than help.


I can agree with this. I'm currently on a site that does this on all parts of it.

I'm just not going to bother messing with it, considering I expect much more here.


----------



## Rayne (Oct 17, 2008)

TyVulpine said:


> Unfortunately, most of the people here in Bits & Bytes are some of the most unhelpful people on the internet. They prefer to bash rather than help.



Just because you got the short end of the stick...


----------



## Xenofur (Oct 17, 2008)

Devious Bane said:


> I can agree with this. I'm currently on a site that does this on all parts of it.
> 
> I'm just not going to bother messing with it, considering I expect much more here.


I expect people to make some kind of attempt on informing themselves about things they use. You use in a wrong manner and thus abuse copyright. By doing so in public you perpetuate this abuse that is utterly rampant in the fandom.

As such i have corrected you and informed you on proper use.

Your response? You motherfucking straight-out lie and claim that "<character name> (c) <asshat>" is not meant to be about the character, but about the image. You deserve not a single bit of courtesy and politeness unless you apologize for lieing about your intent and both correct it and discontinue your abuse.

My anger is righteous and you are deserving of it.


----------



## Ty Vulpine (Oct 17, 2008)

Xenofur said:


> I expect people to make some kind of attempt on informing themselves about things they use. You use in a wrong manner and thus abuse copyright. By doing so in public you perpetuate this abuse that is utterly rampant in the fandom.
> 
> As such i have corrected you and informed you on proper use.
> 
> ...



And that just shows how immature you really are...same as certain other people on FA... you bash, curse and put down... All that really does is show your immaturity. Seriously, if you want people to respect you and believe you, the way you are going about trying to convince people is NOT the way.


----------



## Kimmerset (Oct 17, 2008)

If you haven't figured out by now that telling people not to respond is merely egging them on, you're just going to keep getting flamed and will never figure out why.

The reason they're so hostile towards you in the first place is because you've come in with the vaguest idea of what you're doing and are asking for a solution.Â©


----------



## Xenofur (Oct 17, 2008)

TyVulpine said:


> convince people is NOT the way.


I'm not trying to convince anyone and i do not need to. I am stating facts and he is being a typical dumb juvenile, knowing nothing, being too lazy to look shit up and lieing and making up excuses when shown what's what.

To try and convince him would require me to expend time and energy that he is not worth. As such i state the facts as they are and leave it to him to either take them, learn something and better himself, or alternatively, go on and act like a petulant child.

Lastly, if i were to actually be undeservedly nice with him, i would only be doing him a disservice. A programmer, like an artist, has, if they have any sort of pride in their work, an obligation to take in any sort of criticism openly, dissect it with a critical mind and learn from it or dismiss it as appropiate, no matter how it is worded. If he cannot do that, he should stick to washing dishes.


----------



## Ty Vulpine (Oct 17, 2008)

Xenofur said:


> I'm not trying to convince anyone and i do not need to. I am stating facts and he is being a typical dumb juvenile, knowing nothing, being too lazy to look shit up and lieing and making up excuses when shown what's what.
> 
> To try and convince him would require me to expend time and energy that he is not worth. As such i state the facts as they are and leave it to him to either take them, learn something and better himself, or alternatively, go on and act like a petulant child.



Is bashing him acting like a mature person? Or acting like a child yourself?


----------



## Xenofur (Oct 17, 2008)

Please define bashing. Do no use less than 100 words. After that i will answer your question.


----------



## Rayne (Oct 17, 2008)

Xenofur said:


> Lastly, if i were to actually be undeservedly nice with him, i would only be doing him a disservice. A programmer, like an artist, has, if they have any sort of pride in their work, an obligation to take in any sort of criticism openly, dissect it with a critical mind and learn from it or dismiss it as appropiate, no matter how it is worded. If he cannot do that, he should stick to washing dishes.



This.


----------



## Ty Vulpine (Oct 17, 2008)

Xenofur said:


> Please define bashing. Do no use less than 100 words. After that i will answer your question.




Bashing, as in calling him a child, calling someone an idiot, calling them uneducated, putting them down because they don't know something that you do, and ask for help so they can understand what they're doing wrong, rather than helping them understand. Seriously, bashing someone that's acting like a child (not saying he is) simply drags you down to their level. Same as cursing. That doesn't make you better than them. That doesn't make you the "mature" person.


----------



## Xenofur (Oct 17, 2008)

Please do yourself a favor and scroll up to read the third paragraph quoted by Rayne. I apologize for editing it in before your reply. You were pretty fast and i hadn't noticed you had replied before i wrote it.

Anyhow, i have to disagree then. I am not doing what falls under your definition of bashing. I am stating pure facts. He IS a dumb lazy juvenile. That is a plain fact. Any person who is not dumb and not lazy would at least make a token effort to find out how to pose a question such as the one he had. Furthermore, by the way he types, thinks and by the level of his problem, it is very obvious that he is not an adult. Lastly, he is acting like a child by lieing and making excuse. I am not simply calling him that, as in name calling, i am stating what is undeniable, so that he may recognize it and change for the better.

If he can see the truth in my words, then he will improve himself. If he cannot, then he is worthless from the start and nothing i could've done or said could've affected him positively.

Edit:

These might help you understand my position in a nutshell:
Tough love.
Fly or die.
Swim or drown.


----------



## Ty Vulpine (Oct 17, 2008)

Xenofur said:


> Please do yourself a favor and scroll up to read the third paragraph quoted by Rayne. I apologize for editing it in before your reply. You were pretty fast and i hadn't noticed you had replied before i wrote it.
> 
> Anyhow, i have to disagree then. I am not doing what falls under your definition of bashing. I am stating pure facts. He IS a dumb lazy juvenile. That is a plain fact. Any person who is not dumb and not lazy would at least make a token effort to find out how to pose a question such as the one he had. Furthermore, by the way he types, thinks and by the level of his problem, it is very obvious that he is not an adult. Lastly, he is acting like a child by lieing and making excuse. I am not simply calling him that, as in name calling, i am stating what is undeniable, so that he may recognize it and change for the better.
> 
> If he can see the truth in my words, then he will improve himself. If he cannot, then he is worthless from the start and nothing i could've done or said could've affected him positively.



*Shakes head* But calling him a "child", "lazy" or whatever isn't exactly acting mature, is it? But obviously you don't seem to grasp that, so I give up.


----------



## Xenofur (Oct 17, 2008)

You cling to that word "mature", but you do not grasp its meaning. The word you are looking for is "polite". Yes, i am not being polite. I stated before that he does not deserve any politeness. However the concepts of maturity and politeness are distinctly seperate.


----------



## Rayne (Oct 17, 2008)

TyVulpine said:


> *Shakes head* But calling him a "child", "lazy" or whatever isn't exactly acting mature, is it? But obviously you don't seem to grasp that, so I give up.



It's not about being more mature, it's about seeing if they have the ability to do as Xenofur said and dissect the truly useful information from other people's posts, if they bother to reply at all, and learn both from what was said and their own mistakes. In this case, the question was poorly formed and given without an example of the malfunctioning code. It's little more than tough love.


----------



## Eevee (Oct 17, 2008)

Devious Bane said:


> 1: It basically means, I made it. I drew the pictures, I own them.


No, the text in the image claims that _the character_ is copyrighted to you.  This is incorrect.  Works that you create are automatically copyrighted to you; characters are another thing entirely.  Please do not make claims about intellectual property if you do not understand how it works.

Sigh.

Let's fix this mess.

First off, eight-column tab stops are an abomination, and I can't stand Allman brace style, so I'm going to clean that right up.

Second, give your controls some readable damn names.  You should almost never have a number in the name of anything, and certainly nothing as generic as "button2".  Last I was aware (some five years ago..), the VS standard is to use three-letter control type abbreviations as prefixes, like lstRace or txtName.  Maybe gross, but at least obviously differentiates from local vars, so whatever.  Also far better than naming everything with 'var' at the end.

Third, use labels for labels, not read-only textboxes.

Fourth, comments are for explaining _what_ you're doing or _why_ you're doing it on a higher level, not translating the code into English.  Several lines of "String namevar = whatever;" are very obviously variable declarations; informing the reader of this a second time is a waste.  Also, put space after the //; it's much easier to read.  You should also put them ABOVE a line, not after it, unless you have an extremely short comment related to _just_ that line.  if blocks are not a line.

Fifth, don't compare to true or false, ever.  It's needless clutter.  Comparing true to true just returns true again.

Sixth, you test to see if the race isn't reptilian..  then test to see if it IS reptilian..  then test again to see if it's not.  Again.  This should just be a single if/else.

Seventh, don't write lines that are almost 200 characters long holy christ.

That reduces your code to:


```
private void frmMain_Load(object sender, EventArgs e) {
    txtProfile.AppendText("(C) The Devious Bane, 2008.");
    lstGender.SetSelected(0, true);
    lstRace.SetSelected(0, true);
}

private void btnGenerate_Click(object sender, EventArgs e) {
    // Condistions
    txtProfile.AppendText("\n\n"
                        + "Name: "     + txtName.Text + "\n"
                        + "Codename: " + txtCodename.Text + "\n"
                        + "Age: "      + txtAge.Text + "\n"
                        + "Gender: "   + lstGender.SelectedItem + "\n"
                        + "Race: "     + lstRace.SelectedItem + "\n"
                        + "\nNotices: ");
    if (lstRace.SelectedItem.Equals("Other")) {
        txtProfile.AppendText("\nSpecified Race as '" + txtRaceOther.Text + ".'");
    }
    // Handle errors
    if (lstGender.SelectedItem.Equals("N/A")) {
        txtProfile.AppendText("\nError: Please specify a Gender.");
    }
    if (lstRace.SelectedItem.Equals("N/A")) {
        txtProfile.AppendText("\nError: Please specify a Race.");
    }

    // Load artwork
    if (lstRace.SelectedItem.Equals("Reptilian")) {
        if (lstGender.SelectedItem.Equals("Male")) {
            picCharSheet.Load("Rogers.png");
        }
        if (lstGender.SelectedItem.Equals("Female")) {
            picCharSheet.Load("Noimage.png");
        }
        if (lstGender.SelectedItem.Equals("N/A")) {
            picCharSheet.Load("Noimage.png");
        }
    }
    else {
        // Artwork not done yet
        picCharSheet.Load("Noimage.png");
    }
}
```

I am optimistically assuming that this is actually valid C#.  Never used the language.

The *actual* problem you're having is that you don't check to see if anything at all is selected in either listbox.  You also check for errors (after doing some work, no less) and _keep going_.  Stop as soon as you know something's wrong.

In fact, if n/a isn't a valid option for either listbox, then just remove it.

You can also remove the repeated Noimage.png by making it a default and just changing it if you have the artwork already.

You should also be more consistent with your printing of newlines; sometimes they are at the beginning of a string, sometimes the end, sometimes both.  Keep them at the end, unless a certain string actually needs some blank lines before it.

This leaves me with the following:


```
private void frmMain_Load(object sender, EventArgs e) {
    txtProfile.AppendText("(C) The Devious Bane, 2008.");
}

private void btnGenerate_Click(object sender, EventArgs e) {
    // Handle errors
    if (lstGender.SelectedItem == null) {
        txtProfile.AppendText("Error: Please specify a Gender.\n");
        return;
    }
    if (lstRace.SelectedItem == null) {
        txtProfile.AppendText("Error: Please specify a Race. \n");
        return;
    }

    // Basic profile
    txtProfile.AppendText("\n\n"
                        + "Name: "     + txtName.Text + "\n"
                        + "Codename: " + txtCodename.Text + "\n"
                        + "Age: "      + txtAge.Text + "\n"
                        + "Gender: "   + lstGender.SelectedItem + "\n"
                        + "Race: "     + lstRace.SelectedItem + "\n"
                        + "\nNotices:\n");
    if (lstRace.SelectedItem.Equals("Other")) {
        txtProfile.AppendText("Specified Race as '" + txtRaceOther.Text + ".'\n");
    }

    // Load artwork
    String art_file = "Noimage.png";
    if (lstRace.SelectedItem.Equals("Reptilian")) {
        if (lstGender.SelectedItem.Equals("Male")) {
            art_file = "Rogers.png";
        }
    }
    else {
        // Artwork not done yet
    }
    
    picCharSheet.Load(art_file);

    return;
}
```



TyVulpine said:


> Unfortunately, most of the people here in Bits & Bytes are some of the most unhelpful people on the internet. They prefer to bash rather than help.


Oh, put a sock in it.  All *you* ever do is pop up and whine whenever Pi posts something that isn't sufficiently touchy-feely.  Either go _learn_ something and inject the help you feel is so sorely needed or just keep quiet.


----------



## Ty Vulpine (Oct 17, 2008)

never mind. Not worth it.


----------



## Xenofur (Oct 17, 2008)

In addition: Don't use strings of ifs in succession, use switch statements instead: http://msdn.microsoft.com/en-us/library/06tc147t(VS.80).aspx




TyVulpine said:


> mature/polite


Being mature is NOT the same as being polite. That is why they are different words. They have different meanings. Stop treating them as if they were the same. Also, if you do not like Pi, add him to your ignore list and be happy and blissfully ignorant.


----------



## Eevee (Oct 17, 2008)

TyVulpine said:


> All you do is turn a blind eye when your buddy Pi breaks the rules.


Perhaps you have been blinded to this tidbit in your eternal quest to be angry at everyone, but I am not a moderator.  I have zero special powers on this forum.  All I've said is that, *were* I a moderator, it would be inappropriate for me to deal with Pi from such a position precisely _because_ I know and like him.



TyVulpine said:


> And of course, being head programmer, you get away with quite a bit yourself. Apparently the staff is above the rules. And of course, you're not exactly the most mature/polite person on FA...


I am, in fact, _exactly_ the most mature and polite person on FA, as a recently-conducted poll of myself shows.



TyVulpine said:


> Maybe if he acted a little more grown-up, he'd find people more willing to listen.


I'm pretty sure Pi doesn't care if people listen or not.



TyVulpine said:


> But whatever, I'm done with this thread.


Call everyone immature and then express your disinterest in ever reading the thread again?  Clearly you are a bright shining example of how to post.


----------



## Eevee (Oct 17, 2008)

Xenofur said:


> In addition: Don't use strings of ifs in succession, use switch statements instead: http://msdn.microsoft.com/en-us/library/06tc147t(VS.80).aspx


imo the _right_ thing to do here is a nested hash of filenames, but that seemed a little out of scope  :V


----------



## Xenofur (Oct 17, 2008)

I'm not sure if C# has that, but if so, sure.


----------



## Ty Vulpine (Oct 17, 2008)

Eevee said:


> Perhaps you have been blinded to this tidbit in your eternal quest to be angry at everyone, but I am not a moderator.  I have zero special powers on this forum.  All I've said is that, *were* I a moderator, it would be inappropriate for me to deal with Pi from such a position precisely _because_ I know and like him.
> 
> 
> I am, in fact, _exactly_ the most mature and polite person on FA, as a recently-conducted poll of myself shows.
> ...




I didn't call anyone in paticular immature, I simply said calling people "lazy" or "childish" or cursing doesn't make you mature yourself. There's a difference.


----------



## Xenofur (Oct 17, 2008)

Dude, stop quoting whole posts of other people and snip all but the parts you're specifically replying to. It clutters the forum up and is highly inconsiderate to everyone else.

(I could've said mature now, but i don't want to shake your already wobbly grasp on the english language even more.)


----------



## Ty Vulpine (Oct 17, 2008)

Xenofur said:


> Being mature is NOT the same as being polite. That is why they are different words. They have different meanings. Stop treating them as if they were the same. Also, if you do not like Pi, add him to your ignore list and be happy and blissfully ignorant.



But you can't exactly be mature and be rude (impolite). Or be immature and polite. RL doesn't work that way. (Or, at least that's how I see it)


----------



## Xenofur (Oct 17, 2008)

Gunnery Sergeant Hartman disagrees with you.


----------



## Eevee (Oct 17, 2008)

TyVulpine said:


> I didn't call anyone in paticular immature


oh


TyVulpine said:


> And of course, you're not exactly the most mature/polite person on FA...





TyVulpine said:


> Maybe if he acted a little more grown-up, ...


----------



## Devious Bane (Oct 17, 2008)

Xenofur said:


> Please define bashing. Do no use less than 100 words. After that i will answer your question.


*Bashing varies in many forms* of the broad view *of complete negativity over something minor or insignificant.* Completely insulting someone for saying "Don't reply if you have nothing nice to say" is immature and very dull. If someone is just going to be _negative_, the person has a purpose in telling them not to reply. If it continues, flame wars are triggered as a result when one or both sides start arguing over something so small and being very insulting to each other. Example, the fact of someone abusing copyright when they thought there wasn't any violation since they made whatever content was included. This is a mild topic of misinterpretation in which someone wants to push in a _unnecessary conflict of arguing, insulting, and bashing_ over something completely minor and _in some cases it gets off-topic._
_Bashing is negative and unnecessary_ insults leading into _arguments and flame wars._ The basic reason is because _someone thinks a person is an idiot_ because they didn't know about something. This is beyond immature and inconsiderate which results in people getting ticked off about things they antagonized to begin with. They also whine when they got warned/banned for it.
Through the whole thing, no solution to the problem was even brought up to reasoning.

 Clearly, most of you have gotten off the topic and not only bashed me, even after I said stop, you have pretty much made every one of my points. Its so simple, I didn't have to look this up. Its called Common Sense, you have a brain and it comes as a free service for you. It doesn't take a brain surgeon to figure out what you're doing is immature, ESPECIALLY since most of you are mature adults. Am I wrong? I'm 16, clearly there is a problem with this picture.


----------



## Eevee (Oct 17, 2008)

wow guys telling people they're immature is sure going to convince them to be helpful

it is utterly impossible that people sometimes have a reason to be dicks

stop pontificating and read my damn post


----------



## Pi (Oct 17, 2008)

TyVulpine said:


> But you can't exactly be mature and be rude (impolite). Or be immature and polite. RL doesn't work that way. (Or, at least that's how I see it)



False to an incredible degree. Your perceptions are frequently incorrect and out of line with reality.


----------



## Pi (Oct 17, 2008)

Devious Bane said:


> *Bashing varies in many forms* of the broad view *of complete negativity over something minor or insignificant.* Completely insulting someone for saying "Don't reply if you have nothing nice to say" is immature and very dull. If someone is just going to be _negative_, the person has a purpose in telling them not to reply. If it continues, flame wars are triggered as a result when one or both sides start arguing over something so small and being very insulting to each other. Example, the fact of someone abusing copyright when they thought there wasn't any violation since they made whatever content was included. This is a mild topic of misinterpretation in which someone wants to push in a _unnecessary conflict of arguing, insulting, and bashing_ over something completely minor and _in some cases it gets off-topic._
> _Bashing is negative and unnecessary_ insults leading into _arguments and flame wars._ The basic reason is because _someone thinks a person is an idiot_ because they didn't know about something. This is beyond immature and inconsiderate which results in people getting ticked off about things they antagonized to begin with. They also whine when they got warned/banned for it.
> Through the whole thing, no solution to the problem was even brought up to reasoning.
> 
> Clearly, most of you have gotten off the topic and not only bashed me, even after I said stop, you have pretty much made every one of my points. Its so simple, I didn't have to look this up. Its called Common Sense, you have a brain and it comes as a free service for you. It doesn't take a brain surgeon to figure out what you're doing is immature, ESPECIALLY since most of you are mature adults. Am I wrong? I'm 16, clearly there is a problem with this picture.



Learn how to operate if/else, learn hw to operate bbcode beyond bold, learn how to ask questions that don't suck, learn how to operate in the face of adversity. Your problem is that you suck at coding. Stop sucking, your problem goes away.


----------



## Devious Bane (Oct 17, 2008)

Pi said:


> Learn how to operate if/else, learn hw to operate bbcode beyond bold, learn how to ask questions that don't suck, learn how to operate in the face of adversity. Your problem is that you suck at coding. Stop sucking, your problem goes away.


Well, Why do you think I asked for help? 
What kind of hypocritical point is this? You are telling me to stop sucking and yet you insult me for asking questions on how to fix my coding.
Point made: You point out negatives and pose no solution.

And I did the formatting to point out the basics of my points. Maybe I shouldn't have done that since he wanted about 100 words. Still doesn't excuse the fact you are just being an immature person for no reason. No seriously, hush your mouth.

Also, I asked for this thread to be locked. Can anyone bother doing so before someone loses their temper for no good reason? This is ridiculous.


----------



## Kimmerset (Oct 18, 2008)

Hint: Telling someone to shut up usually results in actually the opposite.  

Now, have you actually tried Eevee's solution and did it work? Because in the midst of all your bitching, it seems you've missed the entire reason you posted this thread.


----------



## Devious Bane (Oct 18, 2008)

Kimmerset said:


> Hint: Telling someone to shut up usually results in actually the opposite.
> 
> Now, have you actually tried Eevee's solution and did it work? Because in the midst of all your bitching, it seems you've missed the entire reason you posted this thread.


I'm _advising_ them to shut up for a good reason. I never specifically pointed out they need to shut up because I wanted to be an ass about it. I'm not the one cussing people out.

Reason 1: I was out of  class because it doesn't meet on Fridays.
Reason 2: I could run the program builder here if my computer wasn't falling apart enough already. No, I don't have anyway to pay for this.
And clearly if this is the case, I'm not the only one obviously. The topic is now useless anyway. That's why I want it locked or preferably, deleted.


----------



## Kimmerset (Oct 18, 2008)

Devious Bane said:


> I'm _advising_ them to shut up for a good reason. I never specifically pointed out they need to shut up because I wanted to be an ass about it. I'm not the one cussing people out.


Regardless, it's done nothing. I don't care why you're saying it, I'm telling you it doesn't solve anything.  Often just as bad as cussing back. 



Devious Bane said:


> Reason 1: I was out of  class because it doesn't meet on Fridays.
> Reason 2: I could run the program builder here if my computer wasn't falling apart enough already. No, I don't have anyway to pay for this.
> And clearly if this is the case, I'm not the only one obviously. The topic is now useless anyway. That's why I want it locked or preferably, deleted.



Sounds like it never had a use in the first place if you're this quick to dismiss it.


----------



## Devious Bane (Oct 18, 2008)

Kimmerset said:


> Regardless, it's done nothing. I don't care why you're saying it, I'm telling you it doesn't solve anything.  Often just as bad as cussing back.
> 
> 
> 
> Sounds like it never had a use in the first place if you're this quick to dismiss it.


It's done nothing because I can't tell them something and actually believe they are going to listen. That's just dumb.

No, its just when there are over 50 posts and about 5 of them are on-topic and helping, its pretty obvious that this thread has failed its purpose.


----------



## Pi (Oct 18, 2008)

I told you to learn what if/else is, what null is, and what a program is.

In the words of someone I know, I hope you write a program some day.


----------



## lilEmber (Oct 18, 2008)

Pi give him a break, stop being a jerk as well, what your saying here is that he 'sucks' what about helping him out a little? You clearly know how to code so why not post something showing him how rather than posting negativity. Just telling him he's wrong or doesn't know what something is isn't going to teach him anything other than you're being a jerk, I know where your coming from but just help the guy out a little rather than bashing him around like a helpless kid.

He clearly wants to know what to do but simply doesn't and is seeking help without being ridiculed for not knowing this. Grow up and do it, I can't help him I don't know about the code he needs help with but surely someone here does with all these comments about him not knowing anything about programs, programing, code, or anything is. They *MUST* be all wise and powerful in this area.


----------



## Hanazawa (Oct 18, 2008)

what the hell guys

locking at OP's request


----------

