I can't figure out what identifier to use, and where:
CODE
//this code will execute every time the user presses enter. when they are finished, i should contain
//the number of names and the array should hold each name
Array names1=new Array[10];
for(int i; i < names1.Length; i++)
{
//the following = gives the error message "identifier expected"
names1[] = TextBox1.Text.ToString();
}
I am trying to sort a list of two to ten names, typed into a text box . The user will press enter after each name
is typed in. When they click a button, the list is supposed to be sorted automatically and then appear in alphabetical
order in the listbox. I am trying to assign each name to an array as the user presses the enter button.
(we don't know how many names will be typed in, but I made the array to hold 10 since that is the maximum number
of names allowed in the list). I know this is kinda sloppy. It probably could be much more efficient.
If you need to see more of the code I can include all of it...or a larger part of it.