Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- NetLib for Clipper, Version 6.0 - ch_hextobin( <chex> [, @<cmemvar> [, <nposition> ] ] ) http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
CH_HEXTOBIN( <cHex> [, @<cMemvar> [, <nPosition> ] ] )


Parameters

<cHex>
Hexadecimal string to convert.

<cMemvar>
Memory variable to receive the binary string.

<nPosition>
Number of the byte in the memory variable for the first byte of the 
binary string.  The default is the first byte (1).


Returns

Binary string equivalent to <cHex>.

The number of binary bytes returned is the number of hexadecimal 
digits/2. If an odd number of hexadecimal digits is specified, there 
will be an implied 0 in the leftmost position.



Description

All hexadecimal digits, including leading zeros and leading and 
trailing blanks are significant, thus the hexadecimal string must be 
scaled to the desire length.

If a memory variable is specified, the resulting binary string will be 
stored into the string starting at the specified <nPosition>. If 
<nPosition> is omitted, 1 is assumed.

No check is made for valid hexadecimal digits, nor is any error 
generated if you attempt to store beyond the end of <cMemvar>.


Examples

// Convert the hex string '454647' 
// to CHR(69) + CHR(70) + CHR(71).

// Note that hex 45 = decimal 69,
// hex 46 = decimal 70, etc.

? CH_HEXTOBIN('454647')
EFG

cVar = 'ABCD___HIJ'
CH_HEXTOBIN('454647', @cVar, 5)
? cVar
ABCDEFGHIJ



See Also: CH_HEXFMBIN()

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