$HexA: Difference between revisions

From m204wiki
Jump to navigation Jump to search
m (1 revision)
mNo edit summary
Line 2: Line 2:
<span class="pageSubtitle"><section begin="desc" />Convert hexadecimal string to EBCDIC equivalent<section end="desc" /></span>
<span class="pageSubtitle"><section begin="desc" />Convert hexadecimal string to EBCDIC equivalent<section end="desc" /></span>


<p class="warning">Most Sirius $functions have been deprecated in favor of Object Oriented methods. The OO equivalent for the $HexA function is [[to be entered]].</p>
<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>


This function converts a hexadecimal string to its EBCDIC equivalent.  
This function converts a hexadecimal string to its EBCDIC equivalent.  
Line 9: Line 9:


The first argument is a string containing the characters  
The first argument is a string containing the characters  
<li>.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.
<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"><section begin="syntax" /> %EBCDIC = $HexA(hex_string)
Line 16: Line 17:
</p>
</p>
<p class="caption">%EBCDIC is set to the EBCDIC equivalent of hex_string.</p>
<p class="caption">%EBCDIC is set to the EBCDIC equivalent of hex_string.</p>
For example, in
For example, in
<p class="code"> %JUNK = $HexA('F1F2F3')
<p class="code"> %JUNK = $HexA('F1F2F3')
</p>
</p>
%JUNK would be set to the string '123' (EBCDIC X'F1F2F3'), and in
%JUNK would be set to the string '123' (EBCDIC X'F1F2F3'), and in
<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.
%JUNK would be set to EBCDIC X'0102' which is a non-displayable string.
<ul class="smallAndTightList">
<ul class="smallAndTightList">
<li>[[Sirius functions]]</li>
<li>[[Sirius functions]]</li>
Line 36: Line 40:
<p class="caption">Products authorizing $HexA
<p class="caption">Products authorizing $HexA
</p>
</p>


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

Revision as of 17:55, 1 February 2011

<section begin="desc" />Convert hexadecimal string to EBCDIC equivalent<section end="desc" />

Most Sirius $functions have been deprecated in favor of Object Oriented methods. The OO equivalent for the $HexA function is the HexToEbcdic (String function).

This function converts a hexadecimal string to its EBCDIC equivalent.

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

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

Syntax

<section begin="syntax" /> %EBCDIC = $HexA(hex_string) <section end="syntax" />

$HexA Function

%EBCDIC is set to the EBCDIC equivalent of hex_string.

For example, in

%JUNK = $HexA('F1F2F3')

%JUNK would be set to the string '123' (EBCDIC X'F1F2F3'), and in

%JUNK = $HexA('102')

%JUNK would be set to EBCDIC X'0102' which is a non-displayable string.

Products authorizing $HexA