Arrays...something isnt woriking

Acid Cool

Newcomer
Joined
Dec 2, 2003
Messages
6
Location
Deep in the rabbit hole
I have a problem whit this part of the code:

Code:
For blur = 1 To maxBlur
   boat.xP(maxBlur - blur) = boat.xP(maxBlur - blur + 1)
   boat.yP(maxBlur - blur) = boat.yP(maxBlur - blur + 1)
Next

I know I can write it like this too:

Code:
For blur = maxBlur To 1 Step -1
   boat.xP(blur) = boat.xP(blur - 1)
   boat.yP(blur) = boat.yP(blur - 1)
Next

But it doesn'z work one way or another....

I want this code to copy array of for example 5 (dim boat.xp(5)) one step backwareds

Example:
Code:
(0, 1, 2, 3, 4, 5) --> (0, 0, 1, 2, 3, 4)

the first value (0) will be changed later on in the code...

How do i doo this????
What is worng with my code????
 
It doesn't shift the values...The values remain always the same except the first one changes but that is because of the code I have aftre this one...

After this code I change only the value of 0 (the first field in this array)...

This code should shift every value right for 1 field
 
Back
Top