Card, UShort and UWord Functions

Purpose

Performs an And 65535

Syntax

card = Card(m%)

card = UShort(m%)

card = UWord(m%)

card: card expression
m%: 32-bit integer expression

Description

All three functions perform the same task, namely limiting a 32-bit integer to 16 bits by clearing the bits 16 to 31.

Example

OpenW 1 : Win_1.FontName = "Courier"

Dim a% = 100000, m% = 67631, s% = 32

Print Bin$(m%, s%)          // 00000000000000010000100000110000

Print Bin$(Card(m%), s%)    // 00000000000000000000100000110000

Print String$(s%, "-")      // --------------------------------

Print Bin$(a%, s%)          // 00000000000000011000011010100000

Print Bin$(UShort(a), s%)   // 00000000000000001000011010100000

Print Bin$(a And 65535, s%) // 00000000000000001000011010100000

Print UWord(a)              // 34464

Remarks

LoCard() is synonymous with these three functions and can be used instead.

See Also

LoCard, Byte(), Word(), Short()

{Created by Sjouke Hamstra; Last updated: 04/03/2017 by James Gaite}