This reminds me of a request I had but sure it will never be fulfilled.
Currently I have do that does this
Procedure ReadBin(Var TheBin; TheBinSize:Integer);
Begin
// read from memory the TheBin at the amount of TheBinSize);
End;
Whet would be nice is this.
Procedure ReadBin(Var thenbin; TheBinSizeInteger = Sizeof(theBin));
Begin
...
end;
With that, You can elect to not provide the SizeoF(Type) coming in and have the compiler do it for me.
There for a simple Readbin(Var SomeDataItemSomeWhere);
this could words, Bytes, Dwords, Records etc.
I don't think type info would help much here because you still need to laboring pain for entering it for the second parameter.