Reputation: 572
I would like to know what is the equivalent to Make32 function in Delphi?
See the attached image...
Upvotes: 0
Views: 569
Reputation: 613322
I know three commonly used approaches.
Bitwise operations
u32 := (u16hi shl 16) or u16lo;
MAKELONG
u32 := MAKELONG(u16lo, u16hi);
LongRec
cast
LongRec(u32).Hi := u16Hi;
LongRec(u32).Lo := u16Lo;
Upvotes: 7
Reputation: 54812
You can use MakeLong
for two Words, and MakeWord
for two bytes.
Upvotes: 6