Solved

C to Delphi

Posted on 2004-03-22
5
218 Views
Last Modified: 2010-04-05
Hi,

Im converting some C++ code to delphi.

Can someone help with this please, Thanks


   x * := ((long)width);

   x / := fontWidth;

   x + := (AR_FIXED_POINT_PRECISION/2);

   x / := AR_FIXED_POINT_PRECISION;

   y * := ((long)height);

   y / := fontHeight;

   y + := (AR_FIXED_POINT_PRECISION/2);

   y / := AR_FIXED_POINT_PRECISION;

return(MAKELONG(x , y ));
0
Comment
Question by:smurff
  • 4
5 Comments
 
LVL 14

Accepted Solution

by:
DragonSlayer earned 50 total points
ID: 10648200
x := x * width;
x := x / fontWidth;
x := x + (AR_FIXED_POINT_PRECISION / 2);
x := x / AR_FIXED_POINT_PRECISION;
y := y * height;
y := y / fontHeight;
y := y + (AR_FIXED_POINT_PRECISION / 2);
y := y / AR_FIXED_POINT_PRECISION;
Result := (x shl 16) + y;
0
 
LVL 14

Expert Comment

by:DragonSlayer
ID: 10648205
oops, change it to

Result := x + (y shl 16);
0
 
LVL 14

Expert Comment

by:DragonSlayer
ID: 10648206
coz MAKELONG is
#define MAKELONG(a, b) \
   ((LONG) (((WORD) (a)) | ((DWORD) ((WORD) (b))) << 16))
0
 
LVL 3

Author Comment

by:smurff
ID: 10648261
Thanks DraganSlayer.... Gee`s 11 minutes, what took you so long ;)
Thats what I love about EE, not only do you get an answer, you get one quicker than anywhere else.

Thanks again
Smurff
0
 
LVL 14

Expert Comment

by:DragonSlayer
ID: 10649366
LoL, Erm... I'll try to trim it to 3 min next time ;-)
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

828 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question