Resize an Array ?

Monkey Targets Forums/Android/Resize an Array ?

Paul - Taiphoz(Posted 2013) [#1]
I'm wondering if this is a bug in Android.

I am trying to resize an array, which builds and works on html5 but throws this error on Android.

-compile:
    [javac] Compiling 3 source files to D:\Source\Monkey\StickRun\stickrun.build\android\bin\classes
    [javac] D:\Source\Monkey\StickRun\stickrun.build\android\src\com\monkeycoder\monkeygame\MonkeyGame.java:9843: error: not a statement
    [javac] 			(c_Image[])bb_std_lang.resizeArray(this.m_FrameSet,1);
    [javac] 			^
    [javac] 1 error


im doing this, at least I think this is whats throwing the error.
Self.FrameSet = Self.FrameSet.Resize(_frames)



therevills(Posted 2013) [#2]
Looks like a bug to me... raise it in the Bug Forum with a runnable example ;)


Paul - Taiphoz(Posted 2013) [#3]
I cant, which is freaking annoying..

tried this and it built fine.

the relevant code hes is the exact same, other than _frames is declared inside the new(params) of a class, why the hell wont it work, I hate it when it just dies like this and does not give a decent error





Paul - Taiphoz(Posted 2013) [#4]
ok got it..

this is the evil bit of code, so I guess it's my fault and this probably is not the best way to clean things up, any thoughts ? it compiles and runs fine on other targets but Android has a fit.

		If Self.CurrentFrame=Self.TotalFrames And (Millisecs()-Self.FrameTime>Self.FrameRate) And Self.Complete=False
			Self.Complete=True
			Self.FrameSet.Resize(1)
			Self.FrameSet[0]=Null
		End If 



therevills(Posted 2013) [#5]
Still a Monkey bug IMO...' good job on the example :-)


Samah(Posted 2013) [#6]
Self.FrameSet = Self.FrameSet.Resize(1)

Alternatively,
Self.FrameSet = []