$PACK directive
Purpose: $PACK
specifies alignment for packing
user defined TYPE structure and UNION members.
Similar to the compiler option -Zp[1,2,4,8,16], which provides
module-level control,
$PACK
provides control at the data-declaration level.
Alignment begins after
$PACK
at the first user defined TYPE structure or
UNION declaration. Definitions are not effected by
$PACK
.
Syntax 1: $PACK(Number) Parameters:
|
Syntax 2: $PACK(push,Number) Parameters:
|
Here is a simple example that demonstrates usage of
$PACK
.
$PACK(push,1) TYPE BMP_HEADER fIdentity AS WORD fFileSize AS LONG fReserved AS LONG fOffset AS LONG fHeaderSize AS LONG fWidth AS LONG fHeight AS LONG fPlanes AS WORD fBPP AS WORD fCompression AS LONG fDataSize AS LONG fHResolution AS LONG fVResolution AS LONG fColors AS LONG fImpColors AS LONG END TYPE $PACK(pop)