WORD.HI |
![]() ![]() |
out = WORD.HI( BYVAL long AS INTEGER, [BYVAL bSigned AS INTEGER=FALSE] ) AS INTEGER
Returns the higher word part of an integer . Same as Win32 HIWORD macro except you can specify if the resulting INTEGER should be treated as signed or unsigned.
Example:
$LIBRARY "MyBASIC2_ExtLib.dll"
PRINT "BIT.AND( 0x00110011 & 0x00100010 ) = 0x";FORMAT( "%08X", BIT.AND( 0x00110011, 0x00100010 ) ), PRINT "BIT.OR( 0x00110011 & 0x00100010 ) = 0x";FORMAT( "%08X", BIT.OR( 0x00110011, 0x00100010 ) ), PRINT "BIT.XOR( 0x00110011 & 0x00100010 ) = 0x";FORMAT( "%08X", BIT.XOR( 0x00110011, 0x00100010 ) ), PRINT "BIT.NOT( 0x00110011 ) = 0x";FORMAT( "%08X", BIT.NOT( 0x0F11F00E ) ),
PRINT "BIT.SHIFT( 0x00000011 ) << 1 = 0x";FORMAT( "%08X", BIT.SHIFT( 0x00000011, -1 ) ), PRINT "BIT.SHIFT( 0x11000000 ) >> 7 = 0x";FORMAT( "%08X", BIT.SHIFT( 0x11000000, 7 ) ),
PRINT "WORD.HI( BIT.NOT( 0x0F11F00E ) ) = 0x";FORMAT( "%08X", WORD.HI( BIT.NOT( 0x0F11F00E ) ) ), PRINT "WORD.LO( BIT.NOT( 0x0F11F00E ) ) = 0x";FORMAT( "%08X", WORD.LO( BIT.NOT( 0x0F11F00E ) ) ),
PRINT "LONG.MAKE( 0x12, 0x34 ) = 0x";FORMAT( "%08X", LONG.MAKE( 0x12, 0x34 ) ),
END |