 |

10-10-2001, 06:45 PM
|
|
Senior Contributor
* Expert *
|
|
Join Date: Jun 2001
Location: Illinois
Posts: 865
|
|
2 Dimensional Control Arrays
|
Does anyone know if there is a way to do a two dimensional control array? This is how it would be used...
Imagine one Form, with 5 frames (Index 0-4), and 10 combo boxes inside of each frame (Indexes 0-9).
Notice the "1" and the "2" when making reference to these controls...
Form1.frm
frame_test1(0) - (4)
combo_test1(0) - (9)
frame_test2(0) - (4)
combo_test2(0) - (9)
etc...
Basically, it takes up "code space" to have to specifically identfity the "1"s and the "2"s in the control names. I can't use 0-9, 10-19, etc., because I am creating the controls dymically.
Thanks!
|
__________________
Sometimes I do not get notification of your post from the forum, which causes a delay. I am apologizing in advance!
|

10-10-2001, 07:12 PM
|
 |
Political Coder
Retired Moderator * Guru *
|
|
Join Date: Mar 2001
Location: London, England
Posts: 8,037
|
|
Re: 2 Dimensional Control Arrays
|
Unfortunately no, you cant have multidimensional control arrays. You can solve your problem using modulo arithmetic. You would have an array of combos only (0 to 39)
To find out which frame combo(23) is in we do:
<pre>FrameNo = 23 Mod 4</pre>
which returns 3, so combo box 23 is in frame 3, assuming frames go from 0 to 3.
Combo 13 goes in frame one (13 Mod 4 = 1). and so on.......
|
|

10-10-2001, 08:13 PM
|
|
Senior Contributor
* Expert *
|
|
Join Date: Jun 2001
Location: Illinois
Posts: 865
|
|
Re: 2 Dimensional Control Arrays
|
thanks Squirm.
Let me try that out.
-Diver
|
__________________
Sometimes I do not get notification of your post from the forum, which causes a delay. I am apologizing in advance!
|

10-11-2001, 05:54 AM
|
|
Senior Contributor
Retired Leader * Expert *
|
|
Join Date: Apr 2001
Location: canada, quebec
Posts: 1,334
|
|
Re: 2 Dimensional Control Arrays
|
in the same state of mind you can use the first digit to determine witch tab you're in like this
1,2,3,4,5,6 would all be in tab 0
11,12,13,14,15 would all be in tab 1
21,22,23,24,25 would all be in tab 2
31,32,33,34,35 would all be in tab 3
just do fix ((index)/10)
|
__________________
Still tons to learn!
|
|
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
|
|
|
| Thread Tools |
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|
|
|