简体   繁体   中英

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

I would like to know what is the equivalent to Make32 function in Delphi?

See the attached image...


在此处输入图片说明

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;

您可以将MakeLong用于两个单词,将MakeWord用于两个字节。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM