|
-
Jan 9th, 2007, 11:44 AM
#1
Thread Starter
Fanatic Member
[RESOLVED] list.addrange question
Hi guys,
If i have a list of strings and i add the contents of a string array to it, using list.addrange(array) then does it copy the last element (that makes the array without any elements added have a length of 1) because i keep getting a null reference exception and have spent the last 3 hours trying to figure out where the null reference is coming from! lol
If it does then is there a way to copy all the elements without the null element at the end of the array?
Thanks for any help
If your problem has been solved then please mark the thread [RESOLVED].
If i have helped then please Rate my post 
-
Jan 9th, 2007, 05:57 PM
#2
Re: list.addrange question
When you call AddRange it simply adds every element of the array to the List. That's all. It doesn't affect the array in any way whatsoever. If any of the elements of the array are null references then the corresponding item in the List will also be a null reference.
How about providing some code because your post is just a little confusing? I don't really know where exactly you mean there's a problem: with the array or the List.
-
Jan 10th, 2007, 03:55 AM
#3
Thread Starter
Fanatic Member
Re: list.addrange question
Thanks for your reply...but i have managed to come up with a solution. Instead of using list.addrange(array) i have simply replaced it with a for loop and used list.add(array(i)).
Thank you for your help though

If your problem has been solved then please mark the thread [RESOLVED].
If i have helped then please Rate my post 
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|