illegal type conversion in function

Blitz3D Forums/Blitz3D Beginners Area/illegal type conversion in function

The Forum Archive is locked. These are the original blitzbasic.com forums, kept so their posts can still be read and searched. No new topics, replies or edits can be made here. To join the conversation, head over to the Blitz3D+ forums.

Can anyone tell me why I'm getting an "Illegal type conversion" error during compiling of this function? The first line after the function declaration is the first problem, but what's wrong with it?

btw - It uses the XLnt GUI functions.

Function Recalc()
ship\CATnum = CATtype$(gui_gadval(hullSelector)+hullMin)
ship\CATdesc$ = CATtype$(gui_gadval(hullSelector)+(10+hullMin))
ship\hullVolFac# = CATtype$(gui_gadval(hullSelector)+(20+hullMin))
ship\hullVol# = ship\volTotal# * ship\hullVolFac#
ship\volRemain# = ship\volTotal# - ship\hullVol#
ship\cost = ship\hullCost
gui_settext(category,"Mass Category: "+ship\massCategory$)
gui_settext(categoryNum,"Mass Category Number: "+ship\massCategoryNum)
gui_settext(volT,"Total Volume: "+ship\volTotal)

gui_settext(hullSelector,ship\hullsAvail$)
gui_settext(CATnum,"CAT: "+ship\CATnum)
gui_settext(catText,"Hull Material: "+ship\CATdesc$)
gui_settext(catVol,"Hull Volume: "+ship\hullVol#)
gui_settext(hullCost,"Hull Cost: "+ship\hullCost)

gui_settext(costT,"Total Cost: "+ ship\cost)
gui_settext(volR,"Volume Remaining: "+ship\volRemain#)
End Function

I've tried setting the object of the type ship to Global but it didn't matter.