Difference: 0LASubrConvertBytesToHex (1 vs. 2)

Revision 22012-02-10 - JeanNeron

Line: 1 to 1
 
META TOPICPARENT name="APPXRuntimeSubroutineAPI"

.CONVERT BYTES TO HEX

Line: 18 to 18
  This subroutine converts a field to hexidecimal characters. The first 2 parameters are required, the <no_chars> is optional. If any required parameters are missing, the subroutine will CANCEL.
Changed:
<
<
<hex_result> will contain the hexidecimal characters corresponding to the data in <data> (Required). This must be PASSed Share "Y" to return the value.
>
>
<hex_result> returns the hexidecimal characters corresponding to the data in <data> (Required). This must be PASSed Share "Y" to return the value.
  <data> is the data you want converted to hexidecimal (Required).

Revision 12012-02-03 - JeanNeron

Line: 1 to 1
Added:
>
>
META TOPICPARENT name="APPXRuntimeSubroutineAPI"

.CONVERT BYTES TO HEX

This subroutine converts a field to hexidecimal characters.


Usage:

      PASS         <hex_result>               FIELD            SHARE? Y
      PASS         <data>                     FIELD            SHARE? N
      PASS         <no_chars>                 FIELD            SHARE? N
      GOSUB    --- .CONVERT BYTES TO HEX
      *        Check for errors
      IF       --- .CONVERT BYTES TO HEX      NE

Description:

This subroutine converts a field to hexidecimal characters. The first 2 parameters are required, the <no_chars> is optional. If any required parameters are missing, the subroutine will CANCEL.

<hex_result> will contain the hexidecimal characters corresponding to the data in <data> (Required). This must be PASSed Share "Y" to return the value.

<data> is the data you want converted to hexidecimal (Required).

<no_chars> is the number of characters of <data> to convert (Optional). If not PASSed, it will default to the length of <data>.

If <data> is not a simple alpha field, it will converted to a simple alpha field first (according to the rules of the SET statement), then that will be converted to hexidecimal.

If <hex_result> is not large enough to contain the result, --- .CONVERT BYTES TO HEX will contain 'Data was truncated'.

Comments:

Read what other users have said about this page or add your own comments.


<--/commentPlugin-->

-- JeanNeron - 2012-02-03

 
This site is powered by the TWiki collaboration platform Powered by PerlCopyright © 2008-2024 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback