-
Oct 4th, 2017, 04:38 PM
#1
Thread Starter
Addicted Member
[RESOLVED] spilt list
Code:
For i = ListBox1.Items.Count - 1 To 0
ListBox2.Items.Add(Split(ListBox1.Items.Item(i).ToString, ":")(0))
ListBox3.Items.Add(Split(ListBox1.Items.Item(i).ToString, ":")(1))
Next
it doesn't throw a error, it just does nothing when i execute this code.. any ideas?
-
Oct 4th, 2017, 05:14 PM
#2
Re: spilt list
What is the value of ListBox1.Items.Count at the start?
-
Oct 4th, 2017, 05:14 PM
#3
Re: spilt list
Put a breakpoint on the For line and step through the code. It looks pretty reasonable, and you say it isn't throwing any exceptions, so you're going to have to dig a bit deeper. If this is in the Load Event handler (or a method called from the Load Event handler), then there is a chance the code isn't even running. The breakpoint would tell you that, because it might not be reached, or it might be reached, but when you step one line further it might just exit.
Otherwise, when you step to the first Listbox2.Items.Add, then highlight the whole contents:
Split(ListBox1.Items.Item(i).ToString, ":")(0)
If you are seeing nothing, then that would be the problem, at which point you then highlight just:
Split(ListBox1.Items.Item(i).ToString, ":")
to see what that is returning, and so forth.
My usual boring signature: Nothing
-
Oct 4th, 2017, 06:17 PM
#4
Thread Starter
Addicted Member
Re: spilt list
it needed sometimes the most obvious thing is missed.
-
Oct 5th, 2017, 10:07 AM
#5
Re: [RESOLVED] spilt list
Yep. Totally missed that one.
My usual boring signature: Nothing
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
|