Convert byte to hexadecimal version of its binary value


      FT_BYT2HEX( cByte ) -> cHexValue


     <cByte> is the byte to convert.


     Three-character string, consisting of two digits of hexadecimal
     notation and letter 'h' to signify hex.  Returns NIL if parameters are


     Can be used to show results of bit manipulation, both before and after.

     This function is presented to illustrate that bit-wise operations
     are possible with Clipper code.  For greater speed, write .C or
     .ASM versions and use the Clipper Extend system.


     These three code lines perform a bitwise AND on bytes with values of
     CHR(20) and CHR(36), and deliver the result as a string in hexadecimal
     format, using 'h' to signify hexadecimal.

          ? FT_BYT2HEX(CHR(20))         // byte1: '14h'
          ? FT_BYT2HEX(CHR(36))         // byte2: '24h'

          ? FT_BYT2HEX(FT_BYTEAND(CHR(20), CHR(36)))
                             // result: '04h'

     For a demonstration of Clipper bit manipulations, compile and
     link the program BITTEST.PRG in the Nanforum Toolkit source code.

 Source: BYT2HEX.PRG

 Author: Forest Belt, Computer Diagnostic Services, Inc.

See Also: FT_BYT2BIT()

2 responses to “FT_BYT2HEX

  1. Pingback: FT Functions | Viva Clipper !

  2. Pingback: FT Conversion | Viva Clipper !

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.