The CvtToHex procedure converts alphabetic characters to two-hex characters representing the top 4 bits and the bottom 4 bits of the character or byte.
hex-value CvtToHex( szInChar 65535A Const Varying |
See also: CvtFromHex ToUpper, ToLower |
If the function succeeds, the return value is the hexadecimal value of the characters from the szInChar parameter.
.....DName+++++++++++EUDS.......Length+TDc.Functions+++++++++++++++++++++++++
D myData S 50A Inz('12345')
D myHex S 100A
.....CSRn01..............OpCode(ex)Extended-factor2++++++++++++++++++++++++++
C callp myHex = CvtToHex(%trimR(myData))
This procedure uses a high-speed, low-level MI instruction.
Note the user of the %trimr() built-in. With out this built-in , the procedure would have also converted the trailing blanks in the 50-position myData field.
The CvtFromHex procedure converts a string containing two-hex characters to a string containing characters whose bytes are composed from the pairs of characters.
char-value CvtFromHex( szInHexValue 65535A Const Varying |
If the function succeeds, the return value is the character version of the hex characters passed to the first parameter.
.....DName+++++++++++EUDS.......Length+TDc.Functions+++++++++++++++++++++++++
D myData S 50A
.....CSRn01..............OpCode(ex)Extended-factor2++++++++++++++++++++++++++
C callp myData = CvtFromHex('F1F2F3F4')
After the CvtFromHex is called, the myData field will contain the character string '1234'.
This procedure uses a high-speed, low-level MI instruction.