Alias / Absolute (avoid variants) inside Records? lazarus / 62-General ---------------------------------------------------------------------- trn76 · 2020-10-30 15:39 How can I use Alias / Absolute (avoid variant in records) inside Records? ...or some other neat solution, that would make my day now that I've had some more coffe'! Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i .. type   Thead_info       = packed array [0..10-1] of cuchar;  Thead_archive    = packed array [0..31-1] of cuchar;  Thead_filename   = packed array [0..256-1] of cuchar;  Thead_comment    = packed array [0..256-1] of cuchar;   PPack = ^TPack;  TPack = record     crc           : cuint;  sum           : cuint;     pack_size     : cuint;    unpack_size   : cuint;     mode          : cint;     year          : cuint;    month       : cuint;    day           : cuint;    hour          : cuint;    minute        : cuint;    second        : cuint;     attributes    : cuint8;    //pack_mode     : cuint8;       // <--- replace this     head_info     : Thead_info;    head_archive  : Thead_archive;    head_filename : Thead_filename;    head_comment  : Thead_comment;     total_pack    : cuint;    total_unpack  : cuint;    total_files   : cuint;    merge_size    : cuint;     filFile       : file;    filName     : string;    filError      : cuint;    filList       : PStringArray;     nodeList      : Pnode;     pack_mode     : cuint8 absolute head_archive[11];    // <--- with this ?   end;  Yes I could do this: Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i procedure something;var pack: TPack;    mode: cuint8;begin  // access  mode := pack.head_archive[11] and $1F;  // but this is cleaner:  mode := pack.pack_mode and $1F;end;  ...hope you get my drift ---------------------------------------------------------------------- ASerge · 2020-10-30 17:44 Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i {$MODE OBJFPC}{$MODESWITCH ADVANCEDRECORDS} type  TheadArchive = array[0..31-1] of UInt8;   TPack = record  strict private    function GetPackMode: UInt8; inline;  public    Attributes: Int8;    HeadArchive: TheadArchive;    filError: Cardinal;    property PackMode: UInt8 read GetPackMode;  end; function TPack.GetPackMode: UInt8;begin  Result := HeadArchive[11];end; var  Pack: TPack;  Mode: UInt8;begin  Mode := Pack.HeadArchive[11] and $1F;  Mode := Pack.PackMode and $1F;end.Code: ASM  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i # [29] Mode := Pack.HeadArchive[11] and $1F;        movw    U_$P$PROJECT1_$$_PACK+12(%rip),%ax        andw    $31,%ax# Var Mode located in register al.Ll6:# [30] Mode := Pack.PackMode and $1F;      movw    U_$P$PROJECT1_$$_PACK+12(%rip),%ax        andw    $31,%ax# Var Mode located in register al ---------------------------------------------------------------------- bytebites · 2020-10-30 17:48 Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i {$ModeSwitch advancedrecords}  type     TPack = record....      filError      : cuint;      filList       : PStringArray;       nodeList      : Pnode;       //pack_mode     : cuint8; absolute head_archive[11];    // <--- with this ?      function packmode:cuint8;    end; ... function TPack.packmode: cuint8;begin  result:=pack_size and $1f;end; ---------------------------------------------------------------------- marcov · 2020-10-30 18:16 property packmode : cuint8 read head_archive[11];