GLBasic forum

Main forum => FAQ => Topic started by: Kyo on 2010-Sep-30

Title: GLBasic IDE, Version: 8.085 - iPhone compile but not work!
Post by: Kyo on 2010-Sep-30

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



Title: Re: GLBasic IDE, Version: 8.085 - iPhone compile but not work!
Post by: trucidare on 2010-Sep-30
anything with 11 touches... there is a thread with this behavior
Title: Re: GLBasic IDE, Version: 8.085 - iPhone compile but not work!
Post by: Kitty Hello on 2010-Oct-01
yes. DIM with GETMOUSECOUNT() or limit your loop to MAX(LEN(mouse[])-1, GETMOUSECOUNT())