Watch, Follow, &
Connect with Us

For forums, blogs and more please visit our
Developer Tools Community.


Welcome, Guest
Guest Settings
Help

Thread: Possible bug..



Permlink Replies: 5 - Last Post: Feb 26, 2018 2:09 AM Last Post By: Robert Triest
Ian Branch

Posts: 442
Registered: 9/23/99
Possible bug..
Click to report abuse...   Click to reply to this thread Reply
  Posted: Feb 25, 2018 2:52 PM
Hi Team,
D10.2.2.
I have the following code..

			Offset := DrawBmp.Canvas.Font.Height div 2;
		


Offset is defined as an Integer. DrawBmp.Canvas.Font.Height is an integer. the 'div' divides one integer into
another and returns an integer.

Yet I get the following error.."E2250 There is no overloaded version of 'Offset' that can be called with these
arguments."

What have I missed please?

Regards,
Ian
Dave Nottage

Posts: 1,850
Registered: 1/7/00
Re: Possible bug..
Click to report abuse...   Click to reply to this thread Reply
  Posted: Feb 25, 2018 4:17 PM   in response to: Ian Branch in response to: Ian Branch
Hi Team,
D10.2.2.
I have the following code..

			Offset := DrawBmp.Canvas.Font.Height div 2;
		


Offset is defined as an Integer. DrawBmp.Canvas.Font.Height is an integer. the 'div' divides one integer into
another and returns an integer.

Yet I get the following error.."E2250 There is no overloaded version of 'Offset' that can be called with these
arguments."

What have I missed please?

Looks like there's something else called Offset that's closer in scope than what you think. Hover the mouse over "Offset", and it should tell you where it's declared.

--
Dave Nottage [TeamB]
Find hints tips and tricks at Delphi Worlds blog: http://www.delphiworlds.com
Ian Branch

Posts: 442
Registered: 9/23/99
Re: Possible bug..
Click to report abuse...   Click to reply to this thread Reply
  Posted: Feb 25, 2018 5:05 PM   in response to: Dave Nottage in response to: Dave Nottage
Hi Dave,
Well Doh! on me. Should have thought of that.
Yes. Offset is in System.Types.Pas. :-(
Renaming now.
Cheers,
Ian
Robert Triest

Posts: 687
Registered: 3/24/05
Re: Possible bug..
Click to report abuse...   Click to reply to this thread Reply
  Posted: Feb 26, 2018 12:11 AM   in response to: Ian Branch in response to: Ian Branch
Renaming now.
But if you rename the OffSet and keep declare it as an integer, you still get a error, right ?
What if your height =3 ? 1.5 can't never be in the Integer., The div always returns a float.
Ian Branch

Posts: 442
Registered: 9/23/99
Re: Possible bug..
Click to report abuse...   Click to reply to this thread Reply
  Posted: Feb 26, 2018 1:19 AM   in response to: Robert Triest in response to: Robert Triest
Robert Triest wrote:

Renaming now.
But if you rename the OffSet and keep declare it as an integer, you still get a error, right ?
What if your height =3 ? 1.5 can't never be in the Integer., The div always returns a float.

Hi Robert,
Renaming Offset to iOffset fixed the issue. No error.
As for div in D10.2.2 - "The Div keyword gives the whole number result of dividing the Dividend by the Divisor.

Any remainder is discarded."

Regards,
Ian
Robert Triest

Posts: 687
Registered: 3/24/05
Re: Possible bug..
Click to report abuse...   Click to reply to this thread Reply
  Posted: Feb 26, 2018 2:09 AM   in response to: Ian Branch in response to: Ian Branch
As for div in D10.2.2 - "The Div keyword gives the whole number result of dividing the Dividend by the Divisor.
Any remainder is discarded."

Ah, yes. Div and Mod
of course..
Legend
Helpful Answer (5 pts)
Correct Answer (10 pts)

Server Response from: ETNAJIVE02