I didn't know what arrays are pathetic eh?
now for a small question
Can you say all array values are x without doing a for/next loop(or similar)?
Printable View
I didn't know what arrays are pathetic eh?
now for a small question
Can you say all array values are x without doing a for/next loop(or similar)?
I'm unsure if I understand your problem... so I'll try tp explain what arrays are:
Definition
An array is a collection of values of the same type
Usage
You need an array where ever you have to do something for more than 1 variable coz you can use a loop then. For example if you make a game and you want to move enemies, without arrays you'd have to do something like this:
If you instead use an array you can replace much code:Code:Dim Enemy1
Dim Enemy2
Dim Enemy3
...
Enemy1.Move
Enemy2.Move
Enemy3.Move
See the difference? Another good thing is that you can change the size of an array at runtime:Code:Dim Enemy(5)
...
Dim A as Long
For A = 0 to 5
Enemy(A).Move
Next
(While preserve means that A does not lose the values already contained when resizing)Code:Dim A() as long
ReDim A(10) 'Set a size
ReDim Preserve A(20) 'Make it bigger
ReDim Preserve A(5) 'and smaller...
well each value in an array can be different(yet similar)(god i hope im right on that ;))
but what if you want all the values in an array to be the same like myarray(1) = 5 myarray(2) = 5....etc
Assume MyArray() size is 5 then you can do this way.
Code:Dim A As integer
For A = 0 to 4: MyArray(A) = 5:Next