[fpc-pascal]Convert C to Pascal
Lubomir.Cabla at cssz.cz
Lubomir.Cabla at cssz.cz
Thu Feb 19 09:16:18 CET 2004
Thanks for your help,
1. that means this command
reg_drq_block_call_back = 0;
is in Pascal
reg_drq_block_call_back := nil;
2. if ( ! reg_drq_block_call_back )
{
...
}
is in Pascal
if reg_drq_block_call_back = nil then
begin
...
end;
3. if ( reg_drq_block_call_back )
{
(* reg_drq_block_call_back) ( & reg_cmd_info );
}
is in Pascal
if reg_drq_block_call_back <> nil then
begin
reg_drq_block_call_back(Addr(reg_cmd_info));
or
reg_drq_block_call_back(@reg_cmd_info);
end;
Is this correct ?
Lubomir Cabla
-----Original Message-----
From: Peter Vreman [mailto:peter at freepascal.org]
Sent: Thursday, February 19, 2004 8:41 AM
To: fpc-pascal at lists.freepascal.org
Subject: Re: [fpc-pascal]Convert C to Pascal
Pascal style:
type
REG_CMD_INFO = record
cmd : byte;
end;
reg_drq_block_call_back = procedure(var r:REG_CMD_INFO);
or more close to C style with pointers:
type
REG_CMD_INFO = record
cmd : byte;
end;
REG_CMD_INFO = ^REG_CMD_INFO;
reg_drq_block_call_back = procedure(pr:PREG_CMD_INFO);
_______________________________________________
fpc-pascal maillist - fpc-pascal at lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
More information about the fpc-pascal
mailing list