• help again please.

    From Chris Hoppman@1:129/305 to All on Sunday, September 26, 2004 11:37:05
    Does anyone have experance in convertting records from pascal to delphi?

    I have been using packed records and that does work, but if I include a set in the record it mess's everything up.


    Like

    aflags = 1..7;
    SizeOf(aflags);

    returns
    tp = 1
    delphi = 1

    aflags = 1..8;(up to 15)
    returns
    tp = 2
    delphi = 2

    aflags = 1..16;
    returns
    tp = 3(up to 23)
    tp(24-31) = 4
    delphi = 4(up to 31)


    How might i get past this?
    --- Renegade v09-19.4 DOS
    * Origin: The Titantic BBS Telnet - ttb.slyip.com (1:129/305)
  • From Jasen Betts@3:640/1042 to Chris Hoppman on Monday, September 27, 2004 09:17:36
    Hello Chris.

    26 Sep 04 10:37, you wrote to all:

    Does anyone have experance in convertting records from pascal to
    delphi?


    I have been using packed records and that does work, but if I include
    a set in the record it mess's everything up.

    aflags = 1..16;
    returns
    (sizes)
    tp = 3(up to 23)
    tp(24-31) = 4
    delphi = 4(up to 31)

    Hmm. 3 byte bitfields are a horrible invention and I understand why the makers of delphiwould want to discourage their use.


    How might i get past this?

    maybe you can use absolute to make the next field overlap the (unused) end of the set

    but that's possibly going to mess other stuff up.

    otherwise you're going to have to read the data into the delphi fields one field at a time. or read it into a buffer (eg array of byte) and copy it across
    leaving gaps where the extra "set" bytes occur,

    but check the documentation first - there might be some sort of a compatibility
    mode you can turn on.

    Jasen
    --- GoldED+/LNX 1.1.4.7
    * Origin: (3:640/1042)