Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- The Guide To Clipper - <b>bin2l()</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
BIN2L()


Syntax:     BIN2L(<expC>)

Purpose:    To convert a character string formatted as a 32-bit signed
            long integer to a Clipper numeric value.

Argument:   <expC> is a four-byte character string in the form of a
            32-bit signed integer number--least significant byte first.
            If more than four characters are specified, the remaining
            are ignored.

Returns:    An integer numeric value.

Usage:      BIN2L() is used in combination with FREAD() to convert a
            four-byte character string formatted as a signed long
            integer to a Clipper numeric.  This is most useful when you
            are reading foreign file types and want to read numeric data
            formatted in its native form.

Library:    EXTEND.LIB

Source:     EXAMPLEA.ASM


----------------------------------- Example --------------------------------

   This example opens a database file using low-level file functions and
   reads the number of records (bytes 4-7).  The result is the same as
   with LASTREC().

   handle = FOPEN("Sales.dbf")
   *
   * Point to byte 4.
   FSEEK(handle, 4, 0)
   *
   * Read the number of records.
   num_recs = SPACE(4)
   FREAD(handle, @num_recs, 4)
   *
   ? LTRIM(STR(BIN2L(num_recs)))          && Result: 84
   FCLOSE(handle)


See Also: BIN2I() BIN2W() I2BIN() L2BIN() FREAD()

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson