$HexA: Difference between revisions

From m204wiki
Jump to navigation Jump to search
m (1 revision)
m (link repair)
 
(26 intermediate revisions by 4 users not shown)
Line 2: Line 2:
<span class="pageSubtitle">Convert hexadecimal string to EBCDIC equivalent</span>
<span class="pageSubtitle">Convert hexadecimal string to EBCDIC equivalent</span>


<p class="warning">Most Sirius $functions have been deprecated in favor of Object Oriented methods. The OO equivalent for the $HexA function is the [[HexToEbcdic (String function)]].</p>
<p class="warn"><b>Note:</b> Many $functions have been deprecated in favor of Object Oriented methods. The OO equivalent for the <var>$HexA</var> function is the <var>[[HexToString (String function)|HexToString]]</var> function.</p>


This function converts a hexadecimal string to its EBCDIC equivalent.  
This function converts a hexadecimal string to its EBCDIC equivalent.  


The $HexA function accepts one argument and returns a string result.
The <var>$HexA</var> function accepts one argument and returns a string result.  
 
The first argument is a string containing the characters
<tt>0</tt> - <tt>9</tt> and <tt>A</tt> - <tt>F</tt>. All other characters are treated as <tt>0</tt>. If the number of characters in the first argument is odd, the first argument is considered to begin with an extra <tt>0</tt> character.


==Syntax==
==Syntax==
<p class="syntax"><section begin="syntax" />%EBCDIC = $HexA(hex_string)
<p class="syntax"><span class="term">%ebcdic</span> = <span class="literal">$HexA</span>(<span class="term">hex_string</span>)
<section end="syntax" /></p>
<p class="caption">$HexA Function
</p>
</p>
<p class="caption">%EBCDIC is set to the EBCDIC equivalent of hex_string.</p>


For example, in
<p>
<p class="code"> %JUNK = $HexA('F1F2F3')
<var class="term">%ebcdic</var> is set to the EBCDIC equivalent of hex_string.</p>
 
<var class="term">hex_string</var> is a string containing the characters
<code>0</code> - <code>9</code> and <code>A</code> - <code>F</code>. All other characters are treated as <code>0</code>. If the number of characters in <var class="term">hex_string</var> is odd, <var class="term">hex_string</var> is considered to begin with an extra <code>0</code> character.
 
==Examples==
The following statement sets %JUNK to the string <code>123</code> (EBCDIC X'F1F2F3'):
<p class="code">%JUNK = $HexA('F1F2F3')
</p>
</p>


%JUNK would be set to the string '123' (EBCDIC X'F1F2F3'), and in
And this statement sets %JUNK to EBCDIC X'0102', which is a non-displayable string.
<p class="code"> %JUNK = $HexA('102')
<p class="code">%JUNK = $HexA('102')
</p>
</p>
%JUNK would be set to EBCDIC X'0102' which is a non-displayable string.


<h2>Products authorizing {{PAGENAMEE}}</h2><ul class="smallAndTightList">
==Products authorizing {{PAGENAMEE}}==
<li>[[Sirius functions]]</li>
<ul class="smallAndTightList">
<li>[[Sirius Functions]]</li>
<li>[[Fast/Unload User Language Interface]]</li>
<li>[[Fast/Unload User Language Interface]]</li>
<li>[[Janus Open Client]]</li>
<li>[[Media:JoclrNew.pdf|Janus Open Client]]</li>
<li>[[Janus Open Server]]</li>
<li>[[Media:JosrvrNew.pdf|Janus Open Server]]</li>
<li>[[Janus Sockets]]</li>
<li>[[Janus Sockets]]</li>
<li>[[Janus Web Server]]</li>
<li>[[Janus Web Server]]</li>
<li>[[Japanese functions]]</li>
<li>Japanese functions</li>
<li>[[Sir2000 Field Migration Facility]]</li>
<li>[[Media:SirfieldNew.pdf|Sir2000 Field Migration Facility]]</li>
 
</ul>
</ul>
<p class="caption">Products authorizing $HexA
</p>


[[Category:$Functions|$HexA]]
[[Category:$Functions|$HexA]]

Latest revision as of 20:17, 13 March 2018

Convert hexadecimal string to EBCDIC equivalent

Note: Many $functions have been deprecated in favor of Object Oriented methods. The OO equivalent for the $HexA function is the HexToString function.

This function converts a hexadecimal string to its EBCDIC equivalent.

The $HexA function accepts one argument and returns a string result.

Syntax

%ebcdic = $HexA(hex_string)

%ebcdic is set to the EBCDIC equivalent of hex_string.

hex_string is a string containing the characters 0 - 9 and A - F. All other characters are treated as 0. If the number of characters in hex_string is odd, hex_string is considered to begin with an extra 0 character.

Examples

The following statement sets %JUNK to the string 123 (EBCDIC X'F1F2F3'):

%JUNK = $HexA('F1F2F3')

And this statement sets %JUNK to EBCDIC X'0102', which is a non-displayable string.

%JUNK = $HexA('102')

Products authorizing $HexA