Page 1 of 1

weird error

Posted: Mon Oct 27, 2025 7:59 am
by morosh
Hello:
what's wrong in the following:

Code: Select all

CreateImage(0, 50, 50)
If StartDrawing(ImageOutput(0))  
  DrawText(0, Int(33.5) >> 1, "", 0)
EndIf
StopDrawing()
I get error that >> can't be used with floats, although I'm passing an integer.

Best Regards

Re: weird error

Posted: Mon Oct 27, 2025 8:12 am
by STARGĂ…TE
The arguments of DrawText were changed recently from integer to double.
This will help:

Code: Select all

Procedure.d Double(Integer.i)
	ProcedureReturn Integer
EndProcedure

DrawText(0, Double(Int(33.5) >> 1), "", 0)

Re: weird error

Posted: Mon Oct 27, 2025 8:42 am
by morosh
Thank you
But the error message is misleading:
Can't use any of the following operands with float or double <<,>>, etc...
not exactly that