Problems with precalculated arrays.

Blitz3D Forums/Blitz3D Beginners Area/Problems with precalculated arrays.

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

Ok,i have tested under another machine and that effect apparently don't happen...(i try to correct it...if i don't succeed i post the code[it's big....])
For the speed of the program...i think that if i store the xcoords and ycoords in an array i spped up a lot the whole procedure.
But it seems that something go wrong.
I have two function:one that create the object and assign it's starting value,and another that calculate the xcoords and ycoords and draw the object.
For storing the x and y coordinates i have dimensioned 2 arrays and i have inserted in the function that draw the object this line:
array(position)=xcoord
array2(position)=ycoord
position=position+1
So i think that the info are coorectly stored because every frame "position"isupgraded to store the new data.
After the animation stop i have a function that write to file the data in this manner
for x=0 to max_array_position
writestring (file,array(position))
writestring (file,array2(position))
position=position+1
next
closefile

But when i open the file in a text editor....i see that only the first x&y coords are written!the other value i see is a bunch of "0,0",something like the array position are empty(i think).
I try to write an example to show the procedure of storing data that i use:

createobject()

function move_object()
*the comand for calculating the coords*
drawimage image,posx,posy
array(array_position)=posx
array2(array_position)=posy
array_position=array_position+1
if animationstop=1 then stop
end function

*main*
create object
if i click button 1 move_object()
if i click button 2 save_coords()
if i click button 3 exit_program
*end main*

function save_coords()
*write file*
for a=0 to array_max_position
writestring (file,array(array_position))
writestring (file,array2(array_position))
array_position=array_position+1
next
closefile file


Someone know where's the error??

(the strange thing is that i use the SAME saving function for storing other coordinates and in this case works well...)