Temp-Table handle

atuldalvi

Member
I have written below program:

DEFINE VARIABLE hTempTable AS HANDLE.
DEFINE VARIABLE hBuffer1 AS HANDLE NO-UNDO.
DEFINE VARIABLE hField1 AS HANDLE NO-UNDO.


CREATE TEMP-TABLE hTempTable.
hTempTable:ADD-NEW-FIELD("Field1", "Integer").
hTempTable:TEMP-TABLE-PREPARE("MyTempTable").


MESSAGE hTempTable:name
VIEW-AS ALERT-BOX INFO BUTTONS OK.

I am printing table name in above program. Just like that how to print field name of that temp table.
 
You could grab the handle to the default buffer associated with the TEMP-TABLE. AFAIK the TEMP-TABLE does not have methods or attributes to retrieve that information.

Coded in Firefox IDE - therefore not syntax checked:
Code:
DEFINE VARIABLE hBuffer AS HANDLE NO-UNDO.
DEFINE VARIABLE hField AS HANDLE NO-UNDO.
DEFINE VARIABLE iField AS INTEGER NO-UNDO.

ASSIGN hBuffer = hTempTable:DEFAULT-BUFFER-HANDLE.

DO iField = 1 TO NUM-FIELDS ( hBuffer ):

    ASSIGN hField = hBuffer:BUFFER-FIELD ( iField ).
    MESSAGE hField:NAME SKIP hField:DATA-TYPE VIEW-AS ALERT-BOX.

END.

Heavy Regards, RealHeavyDude.
 
Back
Top