Release 10.1A: OpenEdge Development:
Progress 4GL 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, BLOB, CLOB, and LONGCHAR data types are limited in size to 32K. MEMPTR and LONGCHAR variables can be any size, and BLOB and CLOB fields can be up to 1GB in size.

> Table 19 lists the data types supported by the Progress 4GL.

> Table 19: Progress data types
> Data type | Description
> --- | ---
> BLOB | A BLOB (Binary Large OBject) consists of a database table or temp-table field that contains a BLOB locator, which points to the associated BLOB data stored in the database. You use a MEMPTR to manipulate the binary contents of a BLOB field in the 4GL.
> CHARACTER | CHARACTER data consists of numbers, letters, and special characters.
> CLASS | A user-defined class provides a common set of data members and methods for any object instance of that class. You can use a class just as you would any Progress built-in data type. You can define variables, parameters, and return types as a class. You can also assign an object reference for a class object instance to a temporary table field defined as a Progress.Lang.Object. For more information about defining a class, see the CLASS statement reference entry in this book. For information about Progress built-in classes, see the "Class Reference" section.
> CLOB | A CLOB (Character Large OBject) consists of a database table or temp-table field that contains a CLOB locator, which points to the associated CLOB data stored in the database. You use a LONGCHAR to manipulate the character contents of a CLOB field in the 4GL.
> COM-HANDLE | A COM-HANDLE is a handle to a COM object (ActiveX Automation object or ActiveX Control).
> DATE | DATE fields contain dates.
> DATETIME | DATETIME data has two parts: a 4GL date and a 4GL time. The unit of time is milliseconds from midnight.
> DATETIME-TZ | DATETIME-TZ data has three parts: a 4GL date, a 4GL time, and an integer representing the time zone offset from Coordinated Universal Time (UTC). The unit of time is milliseconds from midnight.
> DECIMAL | DECIMAL data consists of decimal numbers up to 50 digits in length including up to 10 digits to the right of the decimal point.
> HANDLE | A HANDLE is a pointer to a Progress object. Note: HANDLE and WIDGET-HANDLE can be assigned to each other and used interchangeably.
> INTEGER | INTEGER data consists of whole numbers.
> LOGICAL | LOGICAL data evaluates to TRUE or FALSE (or YES or NO).
> LONGCHAR | A LONGCHAR consists of CHARACTER data that is not limited to 32K in size. You can use a LONGCHAR to manipulate the character contents of a CLOB field in the 4GL.
> MEMPTR | A MEMPTR contains a sequence of bytes in memory.
> RAW | RAW data can be any kind of data, even data from non-OpenEdge databases. It is not converted in any way.
> RECID | A RECID is an unique internal identifier of the current database record. Note: RECID is supported mainly for backward compatibility. For most applications, use ROWID instead.
> ROWID | A ROWID is an unique internal identifier of the current database record.
> WIDGET-HANDLE | A WIDGET-HANDLE is a pointer to a Progress widget. Note: HANDLE and WIDGET-HANDLE can be assigned to each other and used interchangeably.

> Table 20 lists the default data formats for the data types.

> Table 20: Default initial values and display formats
> Data type | Default initial value | Default display format
> --- | --- | ---
> BLOB1 | Unknown value (`?`) | See the footnote at the end of this table.
> CHARACTER | "" (an empty string) | X(8)
> CLASS3 | Unknown value (`?`) | >>>>>>9
> CLOB1 | Unknown value (`?`) | See the footnote at the end of this table.
> COM-HANDLE | Unknown value (`?`) | >>>>>>9
> DATE | Unknown value (`?`) (displays as blanks) | 99/99/99
> DATETIME | Unknown value (`?`) | 99/99/9999 HH:MM:SS.SSS
> DATETIME-TZ | Unknown value (`?`) | 99/99/9999 HH:MM:SS.SSS+HH:MM
> DECIMAL | 0 | ->>,>>9.99
> HANDLE2 | Unknown value (`?`) | >>>>>>9
> INTEGER | 0 | ->,>>>,>>9
> LOGICAL | no | yes/no
> LONGCHAR1 | "" (an empty string) | See the footnote at the end of this table.
> MEMPTR1 | A zero-length sequence of bytes. | See the footnote at the end of this table.
> RAW1 | A zero-length sequence of bytes. | See the footnote at the end of this table.
> RECID | Unknown value (`?`) | >>>>>>9
> ROWID1 | A zero-length sequence of bytes. | See the footnote at the end of this table.
> WIDGET-HANDLE2 | Unknown value (`?`) | >>>>>>9
> You cannot display a BLOB, CLOB, MEMPTR, RAW, or ROWID value directly. However, you can convert a MEMPTR, RAW, or ROWID value to a character string representation using the STRING function and display the result. You can also convert a BLOB to a MEMPTR, and then use the STRING function. A MEMPTR or RAW value converts to a decimal integer string. A ROWID value converts to a hexadecimal string, “0x`hexdigits`,” where `hexdigits` is any number of characters “0" through “9" and “A” through “F”. You can display a CLOB field by converting it to a LONGCHAR, and displaying the LONGCHAR using the VIEW-AS EDITOR LARGE phrase only. To display a HANDLE or WIDGET-HANDLE, you must first convert it using the INTEGER function and display the result. To display a CLASS, you must first convert it using the INTEGER or STRING function and display the result.

> For more information on using the different data types, see OpenEdge Development: Progress 4GL Handbook .

> #### 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

> = Assignment operator, ASSIGN statement

Copyright © 2005 Progress Software Corporation www.progress.com Voice: (781) 280-4000 Fax: (781) 280-4095