StringToHex (String function): Difference between revisions

From m204wiki
Jump to navigation Jump to search
mNo edit summary
 
(31 intermediate revisions by 5 users not shown)
Line 1: Line 1:
This [[Intrinsic classes|intrinsic]] function returns the hex encoded value of the method object string.
{{Template:String:StringToHex subtitle}}
                                                                                                       
StringToHex is available as of version 7.2 of the [[Sirius Mods]].                                     
===StringToHex syntax===                                                                               
  %outStr = string:StringToHex                                                                        
===Syntax Terms===                                                                                     
<dl>                                                                                                   
<dt>%outStr                                                                                           
<dd>A string variable to receive the hex encoded value of the method object string.                   
<dt>string                                                                                             
<dd>The string to be hex encoded.                                                                     
                                                                                                       
</dl>                                                                                                 
===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 (String function)|HexToString]].


===Examples===                                                                                         
The <var>StringToHex</var> [[Intrinsic classes|intrinsic]] function returns the hex encoded value of the method object string.
                                                                                                       
The following statement displays ''''D581A8A281A88599'''':                                             
    [[Intrinsic classes#printtext|printText]] {'Naysayer':stringToHex}


===See also===                                                                                        
==Syntax==
[[List of Intrinsic String Methods]]
{{Template:String:StringToHex syntax}}
===Syntax terms===
<table class="syntaxTable">
<tr><th>%outString</th>
<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>
<td>The string to be hex encoded.</td></tr>
</table>


[[Category:Intrinsic String methods|StringToHex function]]
==Usage notes==
[[Category:Intrinsic methods]]
<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.
[[Category:System methods]]
<li><var>StringToHex</var> always returns an even number of bytes.
<li><var>StringToHex</var> is available as of <var class="product">[[Sirius Mods|Sirius Mods]]</var> Version 7.2.</ul>
 
==Examples==
The following statement displays <code>D581A8A281A88599</code>:
<p class="code">[[PrintText statement|printText]] {'Naysayer':stringToHex}
</p>
 
==See also==
<ul>
<li>The inverse of <var>StringToHex</var> is <var>[[HexToString (String function)|HexToString]]</var>.
</ul>
 
{{Template:String:StringToHex footer}}

Latest revision as of 21:16, 5 November 2012

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

The following statement displays D581A8A281A88599:

printText {'Naysayer':stringToHex}

See also