Page 1 of 1

More functionallity with array of record

Posted: 19 Jun 2009 07:24
by anton
Hi,

I know that the new PRO version for PIC can already do this, but I would like to request it for the dsPIC compiler also.

When you have a array of a record structure as below

Code: Select all

type
  TComPortInfo  = record
    MeterMake   : word;
    BaudRate    : word;
    Parity      : word;
    TCPPort     : word;
    Connected   : word;
    SNumber     : String[17];
  end;

var
  ComPortInfo   : array[0..3] of TComPortInfo;
I wan't to be able to get the address of a record in the array as well as the address of a variable in the array of record for example

Code: Select all

var ptr : ^TComPortInfo;
begin
  ptr := @ComPortInfo[2];
end;
and

Code: Select all

var ptr : ^word;
begin
  ptr := @ComPortInfo[2].TCPPort;
end;
Thank you
Anton