StringToHex (String function): Difference between revisions
Jump to navigation
Jump to search
m (1 revision) |
m (1 revision) |
||
Line 2: | Line 2: | ||
This [[Intrinsic classes|intrinsic]] function returns the hex encoded value of the method object string. | This [[Intrinsic classes|intrinsic]] function returns the hex encoded value of the method object string. | ||
StringToHex is available as of version 7.2 of the [[Sirius Mods]]. | StringToHex is available as of version 7.2 of the [[Sirius Mods]]. | ||
==Syntax== | ==Syntax== | ||
{{Template:String:StringToHex syntax}} | {{Template:String:StringToHex syntax}} | ||
Line 13: | Line 13: | ||
<td>The string to be hex encoded.</td></tr> | <td>The string to be hex encoded.</td></tr> | ||
</table> | </table> | ||
==Usage notes== | ==Usage notes== | ||
*Hex (short for hexadecimal) encoding is usually used for debugging when there is a concern that non-displayable characters (including trailing blanks) might be present in a string. By hex encoding such a string, all non-displayable bytes are converted to displayable hexadecimal equivalents. | *Hex (short for hexadecimal) encoding is usually used for debugging when there is a concern that non-displayable characters (including trailing blanks) might be present in a string. By hex encoding such a string, all non-displayable bytes are converted to displayable hexadecimal equivalents. | ||
*The StringToHex function always returns an even number of bytes. | *The StringToHex function always returns an even number of bytes. | ||
*The inverse of StringToHex is [[HexToString (String function)|HexToString]]. | *The inverse of StringToHex is [[HexToString (String function)|HexToString]]. | ||
==Examples== | ==Examples== | ||
The following statement displays ''''D581A8A281A88599'''': | The following statement displays ''''D581A8A281A88599'''': | ||
[[Intrinsic classes#printtext|printText]] {'Naysayer':stringToHex} | [[Intrinsic classes#printtext|printText]] {'Naysayer':stringToHex} | ||
===See also=== | ===See also=== | ||
[[List of intrinsic String methods]] | [[List of intrinsic String methods]] | ||
[[Category:Intrinsic String methods|StringToHex function]] | [[Category:Intrinsic String methods|StringToHex function]] | ||
[[Category:Intrinsic methods]] | [[Category:Intrinsic methods]] |
Revision as of 14:04, 19 January 2011
Convert an Ebcdic string to hexadecimal (String class)
This intrinsic function returns the hex encoded value of the method object string.
StringToHex is available as of version 7.2 of the Sirius Mods.
Syntax
%outString = string:StringToHex
Syntax terms
%outStr | A string variable to receive the hex encoded value of the method object string. |
---|---|
string | The string to be hex encoded. |
Usage notes
- Hex (short for hexadecimal) encoding is usually used for debugging when there is a concern that non-displayable characters (including trailing blanks) might be present in a string. By hex encoding such a string, all non-displayable bytes are converted to displayable hexadecimal equivalents.
- The StringToHex function always returns an even number of bytes.
- The inverse of StringToHex is HexToString.
Examples
The following statement displays 'D581A8A281A88599':
printText {'Naysayer':stringToHex}