Question: comparsion or flag

G

Guest

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
 
T

tommaso.gastaldi

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:
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top