weird error

Just starting out? Need help? Post your questions and find answers here.
morosh
Enthusiast
Enthusiast
Posts: 335
Joined: Wed Aug 03, 2011 4:52 am
Location: Beirut, Lebanon

weird error

Post 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
PureBasic: Surprisingly simple, diabolically powerful
User avatar
STARGÅTE
Addict
Addict
Posts: 2260
Joined: Thu Jan 10, 2008 1:30 pm
Location: Germany, Glienicke
Contact:

Re: weird error

Post 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)
PB 6.01 ― Win 10, 21H2 ― Ryzen 9 3900X, 32 GB ― NVIDIA GeForce RTX 3080 ― Vivaldi 6.0 ― www.unionbytes.de
Lizard - Script language for symbolic calculations and moreTypeface - Sprite-based font include/module
morosh
Enthusiast
Enthusiast
Posts: 335
Joined: Wed Aug 03, 2011 4:52 am
Location: Beirut, Lebanon

Re: weird error

Post 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
PureBasic: Surprisingly simple, diabolically powerful
Post Reply