|
-
Dec 6th, 2000, 03:35 PM
#1
Thread Starter
Member
I would like to know what an array is?
Im a VB student who's teacher who just aint answering all my questions.
-
Dec 6th, 2000, 03:42 PM
#2
Frenzied Member
Well its like a table that can hold things in every cell.
for instance, MyArray(1 to 5) would be like this
Code:
__________________________
|____|____|____|____|____|
to use them, you would say something like:
MyArray(1) would get you the first cell in the array.
Loops can also do this
Code:
dim i as integer
for i = 1 to 5
MyArray(i) 'bla bla bla
next i
ask if you need any help
-
Dec 6th, 2000, 07:07 PM
#3
Thread Starter
Member
Well I dont quite understand those For...Next statements.
could you please explain that?
-
Dec 6th, 2000, 07:43 PM
#4
For...Next is a type of reptition structure that runs through the values of the given variable starting at the first number specified to the second number specified. Both numbers could be a specific number or a variable with a numeric value. The code between the For and the Next is executed and then the variable value is automatically incremented by a specified value(The default is +1). NOTE:
After the For...Next loop is finished running, the value of the variable is equal to the second number plus the increment value.
Laugh, and the world laughs with you. Cry, and you just water down your vodka.
Take credit, not responsibility
-
Dec 6th, 2000, 08:31 PM
#5
Thread Starter
Member
Thanks to all of you guys.
I really dont quite get it without example code
could u give an example?
-
Dec 6th, 2000, 09:26 PM
#6
PowerPoster
This will print 1 through 10 in the debugger. Press the F8
key so you are able to step into the code.
Code:
Private Sub Command1_Click()
Dim i As Integer
For i = 1 To 10
Debug.Print (i)
Next i
End Sub
-
Dec 6th, 2000, 09:37 PM
#7
Thread Starter
Member
ok i did the debug thing with that example code
and wow! its somewhat clicking. but the i was supposed to go to 10 and it went to 11. what up with that?
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
|