I would like to get a "position" of a structure/record.
Say I have this record:
type
MyStruct = record
MyInteger : Integer;
MyInteger2 : Integer;
MyInteger3 : Integer;
MyFunc : function (FirstParam : WideString; SecondParam : String) : Integer;
MyString : String;
MyString2 : WideString;
MyPchar : pchar;
end;
As you can see this record has a size of 28 bytes (7 vars x 4 bytes). Basically because all the vars are either 4 byte vars (such as Integer) or pointers (also 4 bytes). Now let's say we have this struct loaded in an memory-address (X = 0) (which also means the address for MyInteger would be 0). The address of MyInteger3 (for example) would be 8 (be aware of the X = 0 !) How can I get the position (number/address) of the struct dynamically?
Hope you guys know what I mean? Thanks in advance.
BTW:
Is any Var always 4 bytes in a struct?
EDIT:
This is wrong if you fix the spcae : String[100]