I don't use float arrays very often and I'm glad!
I just was using one to do some benchmarking and came out with very wrong values.
Here's the sample code:
dim _my_array#[0,4]
_my_array#[0,0] = 0
size2 = 10
dim _my_array2#[size2,4]
last_time# = 0.0
for i = 1 to size2
Print("working")
ft# = GetFrameTime()
t_now# = timer()
dT# = t_now# - last_time#
_my_array#[0,0] = _my_array#[0,0] + 1
newSize = round(_my_array#[0,0])
dim _my_array#[newSize , 4]
_my_array#[newSize , 1] = ft#
_my_array#[newSize , 2] = t_now#
_my_array#[newSize , 3] = dT#
_my_array2#[i , 1] = ft#
_my_array2#[i , 2] = t_now#
_my_array2#[i, 3] = dT#
if dT# > 0.017
last_time# = t_now#
endif
Sync()
next i
out$ = ""
out2$ = ""
for i = 1 to size2
o_ft# = _my_array#[i , 1]
o_t_now# = _my_array#[i , 2]
o_dT# = _my_array#[i , 3]
out$ = out$ + str(o_ft# , 2) + " , " + str(o_t_now# , 2) + " , " + str(o_dT# , 2) + chr(10)
o_ft2# = _my_array2#[i , 1]
o_t_now2# = _my_array2#[i , 2]
o_dT2# = _my_array2#[i , 3]
out2$ = out2$ + str(o_ft2# , 2) + " , " + str(o_t_now2# , 2) + " , " + str(o_dT2# , 2) + chr(10)
next i
SetPrintSize(2.0)
repeat
Print("Resized array output")
Print(out$)
Print("Pre-size array output")
Print(out2$)
Print("press ESC to quit")
Sync()
until GetRawKeyPressed(27) = 1
undim _my_array#[]
fileID = OpenToWrite("output.txt" , 0)
WriteLine(fileID , "Resized array output")
WriteLine(fileID , out$)
WriteLine(fileID , "Pre-sized array output")
WriteLine(fileID , out2$)
CloseFile(fileID)
Here's the output (resized array is very wrong -- pre-sized is spot on)
Resized array output
0.00 , 0.55 , 0.00
0.02 , 0.00 , 0.03
0.50 , 0.00 , 0.00
0.02 , 0.57 , 0.00
0.00 , 0.03 , 0.00
0.02 , 0.00 , 0.02
0.00 , 0.58 , 0.00
0.02 , 0.00 , 0.00
0.53 , 0.02 , 0.00
0.02 , 0.60 , 0.03
Pre-sized array output
0.02 , 0.43 , 0.43
0.05 , 0.47 , 0.04
0.02 , 0.48 , 0.02
0.02 , 0.50 , 0.03
0.02 , 0.52 , 0.02
0.02 , 0.53 , 0.03
0.02 , 0.55 , 0.02
0.02 , 0.57 , 0.03
0.02 , 0.58 , 0.02
0.02 , 0.60 , 0.03
I figured folks should know if they don't already.
This was with AppGameKit 10821 tier 1
Just ran a test in v2 and it's fine there, just a warning to any working in v1.