$FUNCNAME$
  BIN2W()
$CATEGORY$
  CONVERSION,MISCELLANEOUS,NUMERIC
$SUMMARY$
   Convert a 16-bit unsigned integer to a numeric value
$LANG_RU$
    16-      .
$SYNTAX$
     BIN2W(<cUnsignedInt>) --> nNumber
$LANG_RU$
     BIN2W(< >) -->  
$ARGUMENTS$
     <cUnsignedInt> is a character string in the form of a 16-bit
     unsigned integer number--least significant byte first.  Only the first
     two characters are used by the function; all others are ignored.
$LANG_RU$
     < > -  ,   
       ,     . 
         ,   .
$RETURNS$
     BIN2W() returns an integer numeric value.
$LANG_RU$
     BIN2W()    .
$DESCRIPTION$
     BIN2W() is a low-level file function that is used with FREAD() to
     convert a two-byte character string formatted as an unsigned integer to
     a xClipper numeric data type.  This is most useful when you are
     reading from a binary file and want to read data in its native format.
$LANG_RU$
     BIN2W() -     , 
          FREAD()  
       ,     ,
        xClipper.     
             
     .
$EXAMPLES$
       This example opens a database file using low-level file
	functions and reads the number of bytes per record (bytes 10-11).
	The result is the same as with RECSIZE():

	#include "Fileio.ch"
	//
	nHandle := FOPEN("Sales.dbf", FO_READ)
	// Note:  The length of a record in Sales.dbf is 124
	//
	// Point to byte 10, the first record size byte
	FSEEK(nHandle, 10, FS_SET)
	//
	// Read record size
	cRecSize := SPACE(2)
	FREAD(nHandle, @cRecSize, 2)
	//
	? LTRIM(STR(BIN2W(cRecSize)))            // Result: 124
	FCLOSE(nHandle)
$LANG_RU$
            ,  
          ,    
         ( 10-11).   ,   
        RECSIZE():

       #include "Fileio.ch"
       //
       nHandle = FOPEN("Sales.dbf", FO_READ)
       //
       //    10-  -   ,
       //    
       FSEEK(nHandle, 10, FS_SET)
       //
       //   
       cRecSize = SPACE(2)
       FREAD(nHandle, @cRecSize, 2)
       //
       ? LTRIM(STR(BIN2W(cRecSize))) // : 124
       FCLOSE(nHandle)
$SEEALSO$
  BIN2I(),BIN2L(),FREAD(),FREADSTR(),I2BIN(),L2BIN()
$END$
