GLBasic IDE, Version: 8.085 - iPhone compile but not work!

Previous topic - Next topic

Kyo


Hi,
After days of work, I managed to install snow leopard XCode 1.6.4 and 3.2.4 and I updated my iPhone at version OS 4.1.

If I use a version created with glbasic 7 of the game,  the app works fine!

If I use a version created with glbasic 8 of the same game  (same code) , the app start but when it comes to the function below, it is terminated.

Why?


Code (glbasic) Select


//Variable Declaration

////////////Touch Mouse
TYPE tMouse
x%
y%
active%
touching%
ENDTYPE

GLOBAL mouse[] AS tMouse
DIM mouse[5]

/////////////////////////////


PRINT "Start Game" ,200,150 //<-It works correctly and is printed on the iPhone screen
SHOWSCREEN


WHILE TRUE

updateMice() //<- when reading this function the iphone closes the application

game()

//ShowFPS()
SHOWSCREEN
WEND

GLOBAL mx%, my%, b1%, b2%

FUNCTION updateMice:
FOR imouse% = 0 TO GETMOUSECOUNT()-1
SETACTIVEMOUSE imouse%
MOUSESTATE mx%, my%, b1%, b2%
mouse[imouse].x=mx
mouse[imouse].y=my
mouse[imouse].active=b1

IF mouse[imouse].active = 0 AND mouse[imouse].touching = 1 THEN mouse[imouse].touching = 0
NEXT

ENDFUNCTION




trucidare

anything with 11 touches... there is a thread with this behavior
MacBook Pro 2,2 GHz Core 2 Duo, 4 GB RAM, 160 GB HDD, 8600M GT
Core i3 - 3,07 GHz, 8 GB Ram, 2.5 TB HDD, Geforce GTX 260+ OC

Kitty Hello

yes. DIM with GETMOUSECOUNT() or limit your loop to MAX(LEN(mouse[])-1, GETMOUSECOUNT())