|
-
Dec 23rd, 2001, 12:10 AM
#1
Thread Starter
Lively Member
curious
i am curious what exactly is a control array?
"Sometimes the only way you can feel good about yourself is by making someone else look bad And I'm tired of making other people feel good about themselves"-Homer Simpson
-
Dec 23rd, 2001, 12:17 AM
#2
Control array is like you put 1 textbox who will have the same name like text1 with a number after it : text1(0).text text1(1).text.
It have many advantage, like you can do some loop :
VB Code:
For i = 0 to ubound(text1) ' Ubound = length of array
text1(i).text = "HI"
Next i
Array keep order in the form and I think it take less memory but I am not sure.
-
Dec 23rd, 2001, 12:29 AM
#3
Member
As the name states, it is an array of controls. It is quite useful; for example if you need to get 10 strings from a user, you can add 10 TextBoxes on a form and do this:
VB Code:
Dim i As Long
For i = 0 To txtMyArray.Count - 1
Msgbox "TextBox #" & i & " contained " & txtMyArray(i).Text
Next i
Also, VB has a limit of 255 controls on one form. But a control array counts as only one control.
-
Dec 23rd, 2001, 12:32 AM
#4
Need-a-life Member
Originally posted by DaoK
VB Code:
For i = 0 to ubound(text1) ' Ubound = length of array
text1(i).text = "HI"
Next i
I guess it should be:
VB Code:
For i = 0 to text1.ubound ' Ubound = length of array
text1(i).text = "HI"
Next i
Emiliano F. Martín
If a post has helped you then please Rate it! (and give the user points he/she deserves by clicking on the image).
Encourage the person who helped you to keep doing it, and give him the points he deserves.
MP3 Organizer: Freeware to logically organize all your MP3s.
-
Dec 23rd, 2001, 12:34 AM
#5
-
Dec 23rd, 2001, 12:40 AM
#6
Need-a-life Member
-
Dec 23rd, 2001, 12:41 AM
#7
Ubound is for variable sorry!!!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|