加入 16 位整数在 Delphi 中生成 32 位?

Join 16-bit integer to make a 32-bit in Delphi?

我想知道 Delphi 中 Make32 函数的等价物是什么?

见附图...


两个Word可以使用MakeLong,两个字节可以使用MakeWord

我知道三种常用的方法。

位运算

u32 := (u16hi shl 16) or u16lo;

MAKELONG

u32 := MAKELONG(u16lo, u16hi);

LongRec

LongRec(u32).Hi := u16Hi;
LongRec(u32).Lo := u16Lo;