Convert a Clipper numeric value to a 32-bit binary integer

     L2BIN(<nExp>) --> cBinaryInteger


     <nExp> is the numeric value to be converted.  Decimal digits are


     L2BIN() returns a four-byte character string formatted as a 32-bit
     binary integer.


     L2BIN() is a low-level file function used with FWRITE() to write
     Clipper numeric values to a binary file.  This function is like
     I2BIN() which formats a Clipper numeric to a 16-bit binary value.

     L2BIN() is the inverse function of BIN2L().


     .  This example creates a new binary file, and then writes a
        series of numbers to the files using L2BIN() to convert the numeric
        value to 32-bit binary form:

        #include "Fileio.ch"
        LOCAL nNumber, nHandle
        nHandle := FCREATE("MyFile", FC_NORMAL)
        FOR nNumber := 1 TO 100
           FWRITE(nHandle, L2BIN(nNumber) + CHR(0))

 Files   Library is EXTEND.LIB, source file is SOURCE\SAMPLE\EXAMPLEA.ASM.

See Also: BIN2I() BIN2L() BIN2W() CHR() FWRITE() I2BIN()


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.