SET-BYTE-ORDER statement
- Last Updated: February 11, 2026
- 1 minute read
- OpenEdge
- Version 13.0
- Documentation
Sets an internal indicator designating the byte-order of the data pointed to by the MEMPTR variable.
Note: Does not apply to SpeedScript programming.
Syntax
|
- memptr
- An expression that returns a MEMPTR.
- integer-expression
-
An expression that returns an integer value that will be used to indicate the byte-ordering of the data in the memory to which the MEMPTR points. integer-expression must be one of the reserved keywords defined in the following table or its corresponding value. If integer-expression is not valid, ABL generates an error.
Table 1. Byte order options Keyword Value Description HOST-BYTE-ORDER1 Same format as the machine where the process that calls SET-BYTE-ORDERis running.BIG-ENDIAN2 A multiple-byte data type is stored with the high-order byte in the lowest address reserved for the data; successively lower-order bytes are stored at successively higher addresses. Note that Internet protocols use BIG-ENDIANbyte-ordering.LITTLE-ENDIAN3 A multiple-byte data type is stored with the low-order byte in the lowest address reserved for the data; successively higher-order bytes are stored at successively higher addresses.
Notes
- The byte order for a MEMPTR is
HOST-BYTE-ORDERby default, that is, ifSET-BYTE-ORDERhas not been called for a given MEMPTR, its byte order isHOST-BYTE-ORDER. SET-BYTE-ORDERby itself never affects data currently in the MEMPTR, that is, it does not actually re-order the data. It only affects how subsequent calls to thePUT-statements andGET-functions work with that MEMPTR variable.