Progress
External Program
Interfaces
Accessing Progress Data
This section describes how to use HLC library functions to access Progress data. For example, you can use the
CAUTION: If you do not follow these guidelines, you can permanently damage your Progress database.prordbi()
function to read an integer field in a shared buffer. Use the following guidelines when accessing Progress data with HLC library functions.
- Use correct data types for the parameters you pass to HLC library functions. In general, C compilers do not verify whether the data types of the parameters you provide in a function call agree with the parameter data type definitions specified in the function declaration.
- Use correct values for the parameters you pass to HLC library functions. For example, HLC functions that access Progress shared buffers use the fhandle parameter. The fhandle parameter has the integer data type. You must set fhandle correctly to read from or write to the correct location in the buffer.
- Use pointer variables properly. Many HLC library functions that access Progress use pointer variable parameters. Improper use of pointer variables can cause you to overwrite random locations in memory, with potentially hazardous results.
The following example demonstrates these guidelines by defining shared buffer custbuf within a 4GL procedure:
Later in your 4GL code, execute a CALL statement that calls a C function. Within the C function, you read the cust-num field. The cust-num field is an integer field in the customer table, for which shared buffer hlcbuff is defined, as follows:
The
prordbi()
function reads an integer field contained in a shared buffer. To determine the HLC library function to use, see the "Function Summary" section in "HLC Library Function Reference."The
prordbi()
function has the following syntax:
The pbufnam parameter points to the name of the specified shared buffer. You supply the name from your Progress application.
The fhandle input parameter is the field handle that
profldix()
returns for the specified field.The index input parameter specifies an index value for an array field. If the field is a scalar, you must set the value of index to 0.
The pvar output parameter points to a long where
prordbi()
returns the value of the specified integer field.The punknown output parameter points to an integer where
prordbi()
returns 1 if the field has the unknown value, and returns 0 otherwise.Figure 2–4 shows a call being made to
prordbi()
that illustrates HLC programming guidelines:Figure 2–4: Example HLC Library Function Call
![]()
Copyright © 2004 Progress Software Corporation www.progress.com Voice: (781) 280-4000 Fax: (781) 280-4095 |