More functionallity with array of record

Beta Testing discussion on mikroPascal for dsPIC30/33 and PIC24.
Post Reply
Author
Message
anton
Posts: 807
Joined: 23 Sep 2004 09:16
Location: South-Africa
Contact:

More functionallity with array of record

#1 Post by anton » 19 Jun 2009 07:24

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
Another proud user of LV 24-33A Development System and mikroPascal PRO for dsPIC :)
PortA not working? Add CMCON := 7; PortD not working? Add ADCON1 := 6;
To paste code on the forum, please use the [b] Code [/b] button !! ;)

Post Reply

Return to “mikroPascal for dsPIC30/33 and PIC24 Beta Testing”