Super Strict

BlitzMax Forums/BlitzMax Beginners Area/Super Strict

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

Ahhh, right I see. (But I am speculating on the answer)

Normaly the compiler would, when not told to cast the Object, instead pass an int handle of the object. So
HandleToObject(B)
Converts the handle b into the object its the handle of, but then because of the lack of cast, turns it back into a handle. (It maybe that HandleToObject(B) just returns an internal handle, but the point is the same)
SuperStrict would pick this up, and stop the compilation saying that it cannot convert INT to Object
AType(HandleToObject(B))
would cast whatever the result is into an AType

Function _HandleToType:TbbEntity (Comparisonhandle:Int)
		
		Select bbEntityClass (Comparisonhandle)
			Case "Pivot"
				Return TbbPivot (HandleToObject(bbEntityID(Comparisonhandle)))
			Case "Light"
				Return TbbLight (HandleToObject(bbEntityID(Comparisonhandle)))
			Case "Camera"
				Return TbbCamera (HandleToObject(bbEntityID(Comparisonhandle)))
			Case "Mirror"
				Return TbbMirror (HandleToObject(bbEntityID(Comparisonhandle)))
			Case "Listener"
				Return TbbListener (HandleToObject(bbEntityID(Comparisonhandle)))
			Case "Sprite"
				Return TbbSprite(HandleToObject(bbEntityID(Comparisonhandle)))
			Case "Terrain"
				Return TbbTerrain (HandleToObject(bbEntityID(Comparisonhandle)))
			Case "Plane"
				Return TbbPlane (HandleToObject(bbEntityID(Comparisonhandle)))
			Case "Mesh"
				Return TbbMesh (HandleToObject(bbEntityID(Comparisonhandle)))
			Case "MD2"
				Return TbbMD2 (HandleToObject(bbEntityID(Comparisonhandle)))
			Case "BSP"
				Return TbbBSP (HandleToObject(bbEntityID(Comparisonhandle)))
		End Select
		
	End Function
This is just a snippet that I grabed quickly, but as you can see each HandleToObject return is imediatly Cast to the type it is.

(For ppl with the SDK. It doesnt work, cos bbEntityClass in the SDK hasnt been implemented properly yet, it was just the most relevent example I had at hand :-)