![]() |
Arraylist ideas
I am trying to pull a value(9 digit number) from a text box then run it through an array and each run... Then list the array in a list box..
:
using System.Data;But its not running through. It keeps inserting "0" in the lstbox Any ideas? |
Re: Arraylist ideas
How are you defining txtstart and txtend?
"EventArgs e" should be "System.EventArgs e" "lstList.Item.Add()" should be "lstList.Items.Add()" Not sure exactly what you are looking for, but maybe this will help. I suppose it depends on what you expect to be in your array. This code takes a nine digit number, pushes it to a string to reference its elements, then reads each element into the listbox. :
private void cmdProcess_Click(object sender, System.EventArgs e) |
Re: Arraylist ideas
Quote:
|
Re: Arraylist ideas
So, if I were to have a txtbox to enter in that 9 digit number you would just use
long num = val txtStart?? |
Re: Arraylist ideas
What are the values of txtstart and txtend when you are entering the for loop? I didn't see where they were defined in code. If they were just referencing the start and end of the nine digit number then use 0 for the start and 8 for the end of your loop like I did. Or was it a range from one nine digit number to another nine digit number?
long num = Convert.ToInt32(txtStart.Text); |
Re: Arraylist ideas
Here is what I am working on.. if this is a little more understanding
http://i81.photobucket.com/albums/j2...7/untitled.jpg you put in say 3216510001 and you supply the end at say 3216510005 so itll display in the lstList 3216510001 3216510002 3216510003 3216510004 3216510005 etc |
Re: Arraylist ideas
txtStart.Text would be a string representation of the text the user entered in that box. int.Parse(txtStart.Text) would return an integer representation of that text if it was formatted properly. If it was not formatted properly, it would throw a FormatException.
|
Re: Arraylist ideas
Try this...
:
using System; |
Re: Arraylist ideas
Quote:
Sweet thanks. I started getting the out of range handler so I was gonna switch it from the int 32 to int64.. Thanks for the help. |
Re: Arraylist ideas
Yeah... my fault for mentioning the int32 without testing it. I caught that problem and switched to int64.
|
| All times are GMT -5. The time now is 3:33 AM. |
Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC