Function W2bin() Foundation

Converts an unsigned numeric value to a 16 bit integer.

W2bin( <nInteger> ) --> cBinary
<nInteger> is a numeric expression whose value is converted to binary format. When the value is not an integer, the decimal places are truncated.

The return value of W2bin() is a character string with two characters which contain the numeric value as a 16 bit integer.


W2bin() converts numeric values in the range of 0 to 65535 to their binary representation. The function returns a character string with two characters whose first character represents the lower value byte. W2bin() ignores decimal places and only converts integers. The counterpart of W2bin() is Bin2w().

W2bin()is frequently used in connection with the low level file functions. This is sometimes done to allow definition of special or unique file formats, or to provide data compression when integer numeric values are being stored.

// W2bin() is used just like I2bin(). The difference 
// lies only in the value range and in the ability 
// to handle negative values. W2Bin() processes 
// only positive integers up to 65535. 

// See function I2bin() 

If you see anything in the documentation that is not correct, does not match your experience with the particular feature or requires further clarification, please use this form to report a documentation issue.