Re: Calculate field offset in a typed record
From: AlanGLLoyd (alanglloyd_at_aol.com)
Date: 12/29/03
- Next message: Sonny Grunter: "Re: Storing an EXE within another EXE?"
- Previous message: AlanGLLoyd: "Re: A calculated field and a Master/Detail relationship"
- In reply to: Rudi Loos: "Calculate field offset in a typed record"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: 29 Dec 2003 08:52:05 GMT
In article <bsntsn$orc$1@ctb-nnrp2.saix.net>, "Rudi Loos" <loos@intekom.co.za>
writes:
>TMyrecord = packed record
> Field1 : Integer;
> Field2 : Array [0..25] of byte;
> ......
> Field24 : Word;
> Field25 : String[13]
> end;
>
>I would like to calculate the offset to field24 with respect to MyRecord.
>I have large records that I use to communicate with an electronic device and
>want to pass an address and byte count so that I will only need to read 2
>bytes at address Field24.
>I tried to subtract the pointers but I get an error "operation not
>applicable"
>
TMyPartrecord = packed record
Field1 : Integer;
Field2 : Array [0..25] of byte;
......
Field22 : whatever;
end;
MyRecordField23Offset := SizeOf(TMyPartRecord);
... and similarly for any other offset.
AlanLloyd
alanglloyd@aol.com
- Next message: Sonny Grunter: "Re: Storing an EXE within another EXE?"
- Previous message: AlanGLLoyd: "Re: A calculated field and a Master/Detail relationship"
- In reply to: Rudi Loos: "Calculate field offset in a typed record"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]