PDA

View Full Version : ListBox problem


emjez15
Jul 5, 2008, 09:30 PM
If lstSchedule.Items.Contains((0)) = True Then
objWriter.WriteLine((0))
End If
If lstSchedule.Items.Contains((1)) = True Then
objWriter.WriteLine((1))

-----------------------until objWriter.WriteLine((7))---------------------

is this correct?. because I want want the program to write if the line 1 or to line 7 exists inside the listbox, so if there's noting written in a certain line, it just bypass and continue with the code..

I already tried this..

If lstSchedule.Items.Contains( lstSchedule.Items(1)) = True Then objWriter.WriteLine(( lstSchedule.Items(1))

[UNTIL ( lstSchedule.Items(7))]

but it just continue when line 1 or to line 7 has an input..
I want to bypass the code line if there's no input..

thanks in advance

:rolleyes:

melondotnet
Jul 25, 2008, 09:37 AM
Okay,

Use a for, for starters (like the pun? )

For val = 1 to 7
~~YOUR CHECK CODE HERE~~
Next

This will just keep running until val = 7.