$Lstr X2C: Difference between revisions
(Automatically generated page update) |
(Automatically generated page update) |
||
Line 45: | Line 45: | ||
<li>[[Fast/Unload User Language Interface]]</li> | <li>[[Fast/Unload User Language Interface]]</li> | ||
<li>[http://m204wiki.rocketsoftware.com/images/4/4a/JoclrNew.pdf Janus Open Client]</li> | <li>[http://m204wiki.rocketsoftware.com/images/4/4a/JoclrNew.pdf Janus Open Client]</li> | ||
<li>[ | <li>[http://m204wiki.rocketsoftware.com/images/1/17/JosrvrNew.pdf Janus Open Server]</li> | ||
<li>[[Janus Sockets]]</li> | <li>[[Janus Sockets]]</li> | ||
<li>[[Janus Web Server]]</li> | <li>[[Janus Web Server]]</li> |
Revision as of 00:06, 13 September 2013
Convert from hexadecimal to byte string
Note: Most Sirius $functions have been deprecated in favor of Object Oriented methods. The OO equivalent for the $Lstr_X2C function is the HexToString function.
This function converts from a hexadecimal encoded string to the decoded byte string. It is identical to $X2C, except it is longstring capable.
The $Lstr_X2C function accepts one argument and returns a string result whose hexadecimal encoding is that argument.
The first argument is a Longstring which is a hexadecimal encoding.
The returned value is the hexadecimal decoding of the argument string. If the argument is not a valid hexadecimal encoding, the null string is returned.
Syntax
%decoded = $Lstr_X2C(string)
%decoded is set to the hexadecimal decoding of string.
usage notes
- You can check for an invalid hexadecimal encoding by checking for the null string return value from $Lstr_X2C. Of course, if it is possible that the argument is null, the null string is a valid returned value. If you need to check for errors, and the null string is a possible argument value, you can use an approach such as the following:
%STR = $Lstr_X2C(%IN) IF %STR EQ '' IF %IN NE '' THEN error code ... END IF END IF
- $Lstr_C2X is the inverse of $Lstr_X2C.
Example
The following code would print Red rum
, which is the character representation of the EBCDIC characters represented in hexadecimal as "D985844099A494":
PRINT $Lstr_X2C('D985844099A494')