StringToHex (String function): Difference between revisions

From m204wiki
Jump to navigation Jump to search
m (1 revision)
m (match syntax diagram to revised template; fix tags.)
Line 1: Line 1:
{{Template:String:StringToHex subtitle}}
{{Template:String:StringToHex subtitle}}


This [[Intrinsic classes|intrinsic]] function returns the hex encoded value of the method object string.
The <var>StringToHex</var> [[Intrinsic classes|intrinsic]] function returns the hex encoded value of the method object string.


<var>StringToHex</var> is available as of version 7.2 of the <var class=product>Sirius Mods</var>.
==Syntax==
==Syntax==
{{Template:String:StringToHex syntax}}
{{Template:String:StringToHex syntax}}
===Syntax terms===
===Syntax terms===
<table class="syntaxTable">
<table class="syntaxTable">
<tr><th>%outStr</th>
<tr><th>%outString</th>
<td>A string variable to receive the hex encoded value of the method object string.                     </td></tr>
<td>A string variable to receive the hex encoded value of the method object <var class="term>string</var>.</td></tr>
<tr><th>string</th>
<tr><th>string</th>
<td>The string to be hex encoded.</td></tr>
<td>The string to be hex encoded.</td></tr>
Line 15: Line 14:


==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.
<ul><li>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 <var>StringToHex</var> function always returns an even number of bytes.
<Li><var>StringToHex</var> always returns an even number of bytes.
*The inverse of <var>StringToHex</var> is [[HexToString (String function)|HexToString]].
<var>StringToHex</var> is available as of <var class="product">[[Sirius Mods]]</var> version 7.2.</ul>


==Examples==
==Examples==
<ol><li>The following statement displays ''''D581A8A281A88599'''':
<p class="code">printText {'Naysayer':stringToHex}
</p></ol>


The following statement displays ''''D581A8A281A88599'''':
<p class="code">[[Intrinsic classes#printtext|printText]] {'Naysayer':stringToHex}
</p>
==See also==
==See also==
<ul><li>The inverse of <var>StringToHex</var> is [[HexToString (String function)|HexToString]].
<li>For details of the <var>printtext</var> statement, please see <var>[[Intrinsic classes#printtext|printText]]</var></ul>
{{Template:String:StringToHex footer}}
{{Template:String:StringToHex footer}}

Revision as of 06:05, 2 February 2011

Convert an Ebcdic string to hexadecimal (String class)


The StringToHex intrinsic function returns the hex encoded value of the method object string.

Syntax

%outString = string:StringToHex

Syntax terms

%outString 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.
  • StringToHex always returns an even number of bytes. StringToHex is available as of Sirius Mods version 7.2.

Examples

  1. The following statement displays 'D581A8A281A88599':

    printText {'Naysayer':stringToHex}

See also

  • The inverse of StringToHex is HexToString.
  • For details of the printtext statement, please see printText