GET-BYTE function
- Last Updated: January 18, 2024
- 1 minute read
- OpenEdge
- Version 12.8
- Documentation
Returns the unsigned 1 byte value at the specified memory location as an INTEGER value.
Syntax
|
- source
- A function or variable that returns a RAW or MEMPTR value. If source is
the Unknown value (
?), GET-BYTE returns the Unknown value (?). - position
- An integer value greater than 0 that indicates the byte position
where you want to find the information. If position is greater
than the length of source, the AVM returns the Unknown value (
?). If position is less than 1, the AVM generates a run-time error.
Examples
In this example, the RAW function goes to the Customer field in the non-OpenEdge database. The GET-BYTE function accesses the first byte and stores the integer value of that byte in the variable ix. The procedure then tests the value, if the integer value is 83 (the character code value for S), the AVM displays the Customer Name.
r-rawget.p
|
The next procedure sets up a MEMPTR region with a character string and uses the GET-BYTE function to display the character code value of each character in the string:
r-mptget.p
|
Notes
- For more information on using the MEMPTR and RAW data types, see OpenEdge Programming Interfaces.
- You can use the alternative keyword GETBYTE instead of GET-BYTE.
See also
LENGTH function, PUT-BYTE statement, RAW function, RAW statement, SET-SIZE statement