• Status: Solved
• Priority: Medium
• Security: Public
• Views: 158

# output to control array

I am working on a project and have setup a two dimensional array "RandomNum(4,4) as integer"  I have also setup 4 control arrays "lblBCard1" to" lblBcard4". What I need to do is generate random numbers between 1 to 75 and fill the RandomNum array (I have that part) now I need to convert my two dimensional array into a one dimensional array so I can display the numbers on the labels. This is part of a Bingo game and the control arrays are the cards (up to 4 players).
0
imfoxman
1 Solution

Commented:
dim iTemp as integer

somthing like...
for itemp = lblcard1.lbound to lblcard1.ubound
lblcard1(itemp).caption = RandomNum(0,itemp)
next itemp
for itemp = lblcard2.lbound to lblcard2.ubound
lblcard2(itemp).caption = RandomNum(1,itemp)
next itemp
for itemp = lblcard3.lbound to lblcard3.ubound
lblcard3(itemp).caption = RandomNum(2,itemp)
next itemp
for itemp = lblcard4.lbound to lblcard4.ubound
lblcard1(itemp).caption = RandomNum(3,itemp)
next itemp
0

Or:

For intElement = 0 To 3
For intControl = 1 To 4
Me.Controls("lblCard" & CStr(intControl)).Item(intElement) = RandomNum(intControl - 1,intElement)
Next
Next
0

Author Commented:
Thanks Crazyman!!!! I appreciate the help.......also thanks to Tmcottee for the alternative view.

Mike
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.