CHN Variable - BBj

For this topic's original documentation, see the CHN Variable - Get Open Channels.

BBj-Specific Information

By default, BBj channel numbers can be any integer from 1 through Integer.MAX_VALUE (2147483647), but values above 32767 have the potential to confuse legacy applications that depend on accurate 16-bit integers in the CHN variable. In BBj 14 and higher, the LEGACY_CHN_LIMIT !COMPAT setting can be set to TRUE to limit OPEN and SELECT channel numbers to values of 32767 or less. This eliminates any possibility of inadvertently using channel numbers that cannot be accurately reported in the CHN variable. For example:

READY

>PRINT STBL("!COMPAT","LEGACY_CHN_LIMIT")

LEGACY_CHN_LIMIT=FALSE

>PRINT Integer.MAX_VALUE

2147483647

>OPEN (Integer.MAX_VALUE)FID(0)

>PRINT HTA(CHN)

0000FFFF

>CLOSE (Integer.MAX_VALUE)

>PRINT STBL("!COMPAT","LEGACY_CHN_LIMIT=TRUE")

LEGACY_CHN_LIMIT=TRUE

>OPEN (Integer.MAX_VALUE)FID(0)

!ERROR=41  (Channel number can't be > 32767)

>

See Also

Variables - Alphabetical Listing