?
Solved

output to control array

Posted on 2002-04-30
3
Medium Priority
?
147 Views
Last Modified: 2010-05-02
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
Comment
Question by:imfoxman
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 13

Accepted Solution

by:
crazyman earned 150 total points
ID: 6982938
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
 
LVL 43

Expert Comment

by:TimCottee
ID: 6982991
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 Comment

by:imfoxman
ID: 6983253
Thanks Crazyman!!!! I appreciate the help.......also thanks to Tmcottee for the alternative view.

Mike
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
This article describes how to use a set of graphical playing cards to create a Draw Poker game in Excel or VB6.
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…
Suggested Courses

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question