Progress
Language Reference
Data Types
The data type of a field defines what kind of data the field can store. All data types other than the MEMPTR data type are limited in size to 32K. MEMPTR variables can be any size.
Table 8 lists the twelve data types supported by the Progress 4GL:
Table 9 lists the default data formats for the data types.
Table 9: Default Display Formats Data Type Default Initial Value Default Display Format CHARACTER "" (an empty string) X(8) COM-HANDLE ? (unknown value) >>>>>>9 DATE ? (unknown value -
displays as blanks) 99/99/99 DECIMAL 0 ->>,>>9.99 HANDLE ? (unknown value) >>>>>>9 INTEGER 0 ->,>>>,>>9 LOGICAL no yes/no MEMPTR1 A zero-length sequence of bytes See the footnote at the bottom of this table. RAW1 A zero-length sequence of bytes See the footnote at the bottom of this table. RECID ? (unknown value) >>>>>>9 ROWID1 A zero-length sequence of bytes See the footnote at the bottom of this table. WIDGET-HANDLE ? (unknown value) >>>>>>9
- You cannot display a MEMPTR, RAW, or ROWID value directly. However, you can convert it to a character string representation using the STRING function and display the result. A ROWID value converts to a hexadecimal string, “0xhexdigits,” where hexdigits is any number of characters “0" through “9" and “A” through “F”. A MEMPTR or RAW value converts to decimal integer string.
For more information on using the different data types, see the Progress Programming Handbook and the Progress External Program Interfaces manual.
NOTES
- In Version 9.0, when you copy one MEMPTR (M1) to another MEMPTR (M2), only the MEMPTR address is copied and both MEMPTRs point to the same memory location (L1). You can change the data in the single memory location and both MEMPTRs will point to the changed data. To clear memory after using the MEMPTRs, you can SET-SIZE = 0 on just one of the MEMPTRs.
In Version 9.1, when you copy one MEMPTR (M1) to another MEMPTR (M2), the data that M1 points to is also copied. Therefore, MEMPTR M1 points to memory location L1, and MEMPTR M2 now points to memory location L2 which contains a copy of the data in L1. You must change the data in both memory locations if you want both MEMPTRs to reflect the change. To clear memory after using the MEMPTRs, you must execute SET-SIZE = 0 on both MEMPTRs to be sure that both memory locations are cleared.
- Starting with Version 9.1, you can assign RAW values to MEMPTR variables and MEMPTR values to RAW variables using the existing Progress assignment operator (=). If the target variable is a RAW data type, Progress will re-size the target variable, if necessary, so that after the assignment it will be the same size as the source. Note that after the assignment (whether RAW = MEMPTR or MEMPTR = RAW), the target variable has a copy of the memory associated with the source — each variable has an independent copy of the data.
- Since RAW variables are limited in size to 32K and MEMPTR variables are not limited in size, if a MEMPTR with a size greater than 32K is copied to a RAW variable, Progress will generate an error.
SEE ALSO
Copyright © 2004 Progress Software Corporation www.progress.com Voice: (781) 280-4000 Fax: (781) 280-4095 |