$HexA: Difference between revisions

From m204wiki
Jump to navigation Jump to search
m (1 revision)
m (1 revision)
Line 12: Line 12:


==Syntax==
==Syntax==
<p class="syntax"><section begin="syntax" /> %EBCDIC = $HexA(hex_string)
<p class="syntax"><section begin="syntax" />%EBCDIC = $HexA(hex_string)
<section end="syntax" /></p>
<section end="syntax" /></p>
<p class="caption">$HexA Function
<p class="caption">$HexA Function

Revision as of 20:32, 24 October 2012

Convert hexadecimal string to EBCDIC equivalent

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