OS/2 Procedures Language 2/REXX


Inf-HTML [About][Toc][Index] 0.9b (c) 1995 Peter Childs


X2B (Hexadecimal to Binary).




 >>---X2B(hexstring)----------><

X2B converts hexstring (a string of hexadecimal characters) to an 
equivalent string of binary digits. hexstring can be of any length; each 
hexidecimal character is converted to a string of four binary digits. The 
returned string has a length that is a multiple of four, and does not 
include any blanks. 
Blanks can optionally be added (at byte boundaries only, not leading or 
trailing) to aid readability; they are ignored. 
If hexstring is null, X2B returns 0. 
Here are some examples: 

X2B('C3')        ==  '11000011'
X2B('7')         ==  '0111'
X2B('1 C1')      ==  '000111000001'

You can combine X2B( ) may be combined with the functions D2X( ) and C2X( 
) to convert decimal numbers or character strings into binary form. 
Here are some examples: 

X2B(C2X('C3'x))  ==  '11000011'
X2B(D2X('129'))  ==  '10000001'
X2B(D2X('12'))   ==  '1100'
  

Inf-HTML End Run - Successful