APPX Software Library

Chapter 4-8: Runtime Subroutine's and Predefined Processes

.CONVERT BYTES TO HEX

This subroutine converts a field to hexidecimal characters.

Usage:

Screen capture

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> 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).

<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'.