|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Question: comparsion or flagthis arraylist serve as a flag if the value inside the arraylist is 1 then that mean it's on and if it's 0 then it's off so i got this code Dim i, a As Integer i = arlsYN.Count a = 0 Do Until a = i If CInt(arlsYN.Item(a)) = 1 Then 'do something Else it should move to the next item in the arraylist but i don't know how to do this End If a += 1 Loop how do i move to the next item in the arraylist if the value come up as 0 and it is not equal to 1, i want the arraylist to move to the next item if it encounter item with 0 value in it. thank Dim a As New ArrayList(New Integer() {1, 1, 0, 1})
For Each flag As Integer In a If flag = 0 Then Continue For MsgBox("flag is 1") Next flag -tom dotnetnoob ha scritto: Show quoteHide quote > let's say i have a arraylist that contain 1 1 0 1 > > this arraylist serve as a flag if the value inside the arraylist is 1 then > that mean it's on and if it's 0 then it's off > > so i got this code > > Dim i, a As Integer > i = arlsYN.Count > a = 0 > > Do Until a = i > > If CInt(arlsYN.Item(a)) = 1 Then > 'do something > > Else > it should move to the next item in the arraylist but i don't > know how to do this > End If > a += 1 > Loop > > how do i move to the next item in the arraylist if the value come up as 0 > and it is not equal to 1, i want the arraylist to move to the next item if it > encounter item with 0 value in it. > > thank
Microsoft (R) Visual Basic Compiler has encountered a problem and needs to close. :o(
How do I handle this Programmable LEGO blocks? Newbie question - VB.net, referencing controls Week Ending Question: arraylist and item Discrepancy in DataGridView column order & databound DataTable last API question.... how to hardcode lots of text into a textbox/RichTextbox? Need help/advice to make a decision |
|||||||||||||||||||||||