| 
       CREATE BUFFER handle FOR TABLE  table-name  table-handle  buffer-handle
        BUFFER-NAME buffer-name IN WIDGET-POOL widget-pool-name | 
| 
       DEFINE VARIABLE ix AS INTEGER NO-UNDO.
        DEFINE VARIABLE qh AS HANDLE NO-UNDO. DEFINE VARIABLE bh AS HANDLE NO-UNDO. DEFINE VARIABLE fh AS HANDLE NO-UNDO EXTENT 10. CREATE BUFFER bh FOR TABLE "Customer". CREATE QUERY qh. qh:SET-BUFFERS(bh). qh:QUERY-PREPARE("FOR EACH Customer"). qh:QUERY-OPEN(). qh:GET-FIRST(). DISPLAY bh:NAME. REPEAT ix = 1 TO 10: fh[ix] = bh:BUFFER-FIELD(ix). DISPLAY fh[ix]:NAME STRING(fh[ix]:BUFFER-VALUE). END. qh:QUERY-CLOSE(). bh:BUFFER-RELEASE(). DELETE OBJECT bh. DELETE OBJECT qh. | 
| 
       DEFINE VARIABLE hbuf  AS HANDLE NO-UNDO. /* Default buffer object */
        DEFINE VARIABLE htab AS HANDLE NO-UNDO. /* Temp-table object */ DEFINE VARIABLE hbuf1 AS HANDLE NO-UNDO. /* 2nd non-default buffer object */ DEFINE TEMP-TABLE tt1 NO-UNDO FIELD x AS CHARACTER. hbuf = BUFFER tt1:HANDLE. /* Static temp-table's default buffer */ htab = TEMP-TABLE tt1:HANDLE. /* Static temp-table handle (not buffer) */ /* Different ways to create an alternate temp-table buffer */ CREATE BUFFER hbuf1 FOR TABLE BUFFER tt1:HANDLE. /* From static tt's default buffer */ CREATE BUFFER hbuf1 FOR TABLE hbuf. /* From static tt's default buffer */ CREATE BUFFER hbuf1 FOR TABLE TEMP-TABLE tt1:HANDLE. /* From static tt's handle */ CREATE BUFFER hbuf1 FOR TABLE htab. /* From static tt's handle */ CREATE BUFFER hbuf1 FOR TABLE "tt1". /* From static tt's name */ | 
 If the character expression, table-name, identifies a temp-table defined as REFERENCE-ONLY, the statement sets handle to an unbound object that cannot function as a buffer object. To create a valid buffer object for such a table, use FOR TABLE table-handle or buffer-handle instead.
If the character expression, table-name, identifies a temp-table defined as REFERENCE-ONLY, the statement sets handle to an unbound object that cannot function as a buffer object. To create a valid buffer object for such a table, use FOR TABLE table-handle or buffer-handle instead.
   Unless you need to use an alternate buffer, the most economical and cleanest way to obtain a buffer object handle for a table is to retrieve the handle for its default buffer. For example:
Unless you need to use an alternate buffer, the most economical and cleanest way to obtain a buffer object handle for a table is to retrieve the handle for its default buffer. For example:
  | 
       DEFINE VARIABLE hbuf AS HANDLE NO-UNDO.
        DEFINE VARIABLE htab AS HANDLE NO-UNDO. DEFINE TEMP-TABLE tt2 NO-UNDO FIELD x AS CHARACTER. CREATE TEMP-TABLE htab. htab:TEMP-TABLE-PREPARE( "dynTT" ). /* Obtaining the default buffer for a table */ hbuf = BUFFER Customer:HANDLE. /* For a database table */ hbuf = BUFFER tt2:HANDLE. /* For a static temp-table */ hbuf = htab:DEFAULT-BUFFER-HANDLE. /* For a dynamic temp-table */ |