C to Delphi
From: Bob Richardson (bobrNO_at_SPAMhidbey.com)
Date: 03/21/04
- Next message: Marco van de Voort: "Re: C to Delphi"
- Previous message: gajo: "I'm having trouble with SQL"
- Next in thread: Marco van de Voort: "Re: C to Delphi"
- Reply: Marco van de Voort: "Re: C to Delphi"
- Reply: Duncan Murdoch: "Re: C to Delphi"
- Reply: AlanGLLoyd: "Re: C to Delphi"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Sun, 21 Mar 2004 13:25:59 -0800
I've had good success in this project. The approach I've used is to
gradually change the C code to look more like Delphi. In particular this
meant converting many of the "for" statement to "while" statements. Once I
had dumbed down the C, I then converted it, pretty much line for line, into
Delphi, but with as much typecasting as possible. Of course there are lots
of little "gotchas" - like:
const
alpha = 'abcd'
in C the 'a' is in alpha[0] while it's in alpha[1] in Pascal.
I presume that 0x8000 in C = $8000 in Pascal.
I think I'm down to just this one question.
The following C line:
if (success ? !(PlayNS(player)) : PlayNS(player))
{
was converted to
if success then
success := not PlayNS(player)
else
success := PlayNS(player);
if success then
begin
BUT THIS DOESN'T WORK. note: PlayNS returns a boolean.
How should I translate
if (success ? !(PlayNS(player)) : PlayNS(player))
- Next message: Marco van de Voort: "Re: C to Delphi"
- Previous message: gajo: "I'm having trouble with SQL"
- Next in thread: Marco van de Voort: "Re: C to Delphi"
- Reply: Marco van de Voort: "Re: C to Delphi"
- Reply: Duncan Murdoch: "Re: C to Delphi"
- Reply: AlanGLLoyd: "Re: C to Delphi"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|