I would like to know what an array is?
Im a VB student who's teacher who just aint answering all my questions.
Printable View
I would like to know what an array is?
Im a VB student who's teacher who just aint answering all my questions.
Well its like a table that can hold things in every cell.
for instance, MyArray(1 to 5) would be like this
to use them, you would say something like:Code:__________________________
|____|____|____|____|____|
MyArray(1) would get you the first cell in the array.
Loops can also do this
ask if you need any help :DCode:dim i as integer
for i = 1 to 5
MyArray(i) 'bla bla bla
next i
Well I dont quite understand those For...Next statements.
could you please explain that?
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.
Thanks to all of you guys.
I really dont quite get it without example code
could u give an example?
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
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?