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
Solved

output to control array

Posted on 2002-04-30
3
142 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
3 Comments
 
LVL 13

Accepted Solution

by:
crazyman earned 50 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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Specify ip address in my connection string for sas 2 65
Run code from text file in vb 1 71
Child Form in front 4 49
IF ELSE Statement in Excel Macro VBA 16 75
Introduction I needed to skip over some file processing within a For...Next loop in some old production code and wished that VB (classic) had a statement that would drop down to the end of the current iteration, bypassing the statements that were c…
Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
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…

790 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