GLBasic forum

Main forum => Bug Reports => Topic started by: MrTAToad on 2009-Jan-13

Title: error : redefinition as different type : xPos is of type DGInt
Post by: MrTAToad on 2009-Jan-13
With the follow code :

Code (glbasic) Select
FUNCTION displayShapes:shapeIndex,sIndex%,playerIndex%,xPos%,yPos%,xSize%
LOCAL loop%
LOCAL index%

index%=(playerIndex%*MAX_SHAPES%)+IMAGE_PLAYER1_CIRCLE%

DRAWRECT (xPos%+shapeIndex)-1.0,yPos%-1,spriteLoadData[IMAGE_PLAYER1_CIRCLE%].xSize%+2, _
spriteLoadData[IMAGE_PLAYER1_CIRCLE%].ySize%+2,RGB(255,0,0)

FOR loop%=0 TO MAX_SHAPES%-1
DRAWSPRITE index%+loop%,xPos%,yPos%
INC xPos%,xSize%
NEXT

DRAWSPRITE index%+sIndex%,(options.screenWidth%-spriteLoadData[index%+sIndex%].xSize%)/2,yPos%+spriteLoadData[index%+sIndex%].ySize%+4
ENDFUNCTION


I get "redefinition as different type : xPos is of type DGInt" (it complains on the DRAWRECT line).  However, as you can see xPos isn't re-defined in the function...

The actual cause of the problem is the following :

Code (glbasic) Select
status=addGraphic(ballDropper,isFirst%,FALSE,xPos,yPos,angle,rescaleTime)

For some reason the first function is trying to use variables globally created by the addGraphic routine, when I think the two should be wholly seperate
Title: Re: error : redefinition as different type : xPos is of type DGInt
Post by: Kitty Hello on 2009-Jan-13
Send me the project, or a complete sample showing the error.
Are you updated?
Title: Re: error : redefinition as different type : xPos is of type DGInt
Post by: MrTAToad on 2009-Jan-13
Oh yes, I'm all updated :)

I'll send you the project soon.

I forgot to put in the definition for GetLastError() before I sent the project O_O