I don't think you want to place it in the type just because you can. I really don't see why you would want a function like this inside an extended type. If you extend TRectangle with MyTRectangle then one or both of your types need to be a MyTRectangle. If I defined TRectangle myself I might put it in but in this case, I would just do
function Intersect:Int( r1:TRectangle, r2:TRectangle )
'// Thanks to Shagwana for this
return ( ( ( ( (r2.X + r2.W) - r1.X) ^ ( r2.X - (r1.X + r1.W) ) ) And ( ( r2.Y - (r1.Y + r1.H) ) ^ ( (r2.Y + r2.H) - r1.Y ) ) ) And $80000000 )
End Method
this function just compares base information that's why I wouldn't put it in an extended type.
function Intersect:Int( r1:TRectangle, r2:TRectangle )
'// Thanks to Shagwana for this
return ( ( ( ( (r2.X + r2.W) - r1.X) ^ ( r2.X - (r1.X + r1.W) ) ) And ( ( r2.Y - (r1.Y + r1.H) ) ^ ( (r2.Y + r2.H) - r1.Y ) ) ) And $80000000 )
End Method
this function just compares base information that's why I wouldn't put it in an extended type.