Hi,

Another newbie question i am afraid, I have created a game of pontoon it generates the numbers into an array and the assigns the values to the labels. this all works great.

however the bit that i am stuck on is creating a player turn as each label has a name lnlP1Card1 to lblP1Card5 for player 1 and lblP2Card1 -5 for player 2 etc. I tried to create a set of if statements that checked a counter and then if the counters value matched the if statement the players turn moved to the next player. sample code:

If pcount < 5 Then
Do
If pcount = 1 Then
twist()
lblP1Card3.Text = rand
pcount += 1
Exit Do
ElseIf pcount = 2 Then
twist()
lblP2Card3.Text = rand
pcount += 1
Exit Do
ElseIf pcount = 3 Then
twist()
lblP3Card3.Text = rand
pcount += 1
Exit Do
ElseIf pcount = 4 Then
twist()
lblP4Card3.Text = rand
pcount += 1
Exit Do
End If
Loop
ElseIf pcount > 4 < 9 Then
Do
If pcount = 5 Then
twist()
lblP1Card4.Text = rand
pcount += 1
Exit Do
ElseIf pcount = 6 Then
twist()
lblP2Card4.Text = rand
pcount += 1
Exit Do
ElseIf pcount = 7 Then
twist()
lblP3Card4.Text = rand
pcount += 1
Exit Do
ElseIf pcount = 8 Then
twist()
lblP4Card4.Text = rand
pcount += 1
Exit Do
End If
Loop
ElseIf pcount > 8 < 13 Then
Do
If pcount = 9 Then
twist()
lblP1Card5.Text = rand
pcount += 1
Exit Do
ElseIf pcount = 10 Then
twist()
lblP2Card5.Text = rand
pcount += 1
Exit Do
ElseIf pcount = 11 Then
twist()
lblP3Card5.Text = rand
pcount += 1
Exit Do
ElseIf pcount = 12 Then
twist()
lblP4Card5.Text = rand
pcount += 1
Exit Do
End If
Loop
End If
this worked until th ecounter hit 9 and then it would not enter the third set of if statements. I am aware that this is not a good approach and would appreciatte any help with this issue.

One thought i had was to increment the label number for player and card but i could not get that to work either.

please help


thanks in advance

tim