Progress
Language Reference
GET-BYTE Function
Returns the unsigned 1 byte value at the specified memory location as an INTEGER.
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, Progress returns the unknown value (?). If position is less than 1, Progress generates a run-time error.
EXAMPLESIn this example, the RAW Function goes to the customer field in the non-Progress database. The GET-BYTE function accesses the first byte and stores the integer value of that byte in the variable i. The procedure then tests the value, if the integer value is 83 (the character code value for S), Progress displays the name.
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.
NOTES
- For more information on using the MEMPTR data type, see the Progress External Program Interfaces manual.
- For more information on using the RAW data type, see the Progress Programming Handbook chapter on accessing databases.
- You can use the alternative keyword GETBYTE instead of GET-BYTE.
SEE ALSO
LENGTH Function, PUT-BYTE Statement, RAW Function (ORACLE only), RAW Statement (ORACLE only), SET-SIZE Statement
Copyright © 2004 Progress Software Corporation www.progress.com Voice: (781) 280-4000 Fax: (781) 280-4095 |