Question Progress In put parameter Table

Laurent T

New Member
Hello,
I want to create a procedure to exploit any Table.

As example, i have a TMP_Table :
Code:
DEFINE TEMP-TABLE TT1
    FIELD facnum    AS CHARACTER LABEL "Invoice #"
    FIELD facdat    AS DATE LABEL "Date".
I fill the TEMP-Table. Then i want to pass it as parameter.
Code:
RUN \Test.p (INPUT TT1).
On my procedure, i don't undestand how i can do that. The help doesn't provide example :(
That doesn't work :
Code:
DEFINE INPUT PARAMETER TABLETemp AS TABLE .  /*  TABLE-HANDLE  */
Anyone can explain me how to to that ?
Thanks
 

Stefan

Active Member
Code:
run test.p ( temp-table tt1:handle ).
Code:
define input parameter i_ht as handle no-undo.

def var hb as handle no-undo.

hb = i_ht:default-buffer-handle.

hb:find-first().

message hb::facnum.
see ABL Dojo
 

Laurent T

New Member
Thx, it works perfectly.
I use the handle as parameter, then i use a query for read data.
Code:
    CREATE QUERY hQuery.
    /* Set the buffer */
    hQuery:SET-BUFFERS(TABLETemp).
    /* Create a query-string */
    hQuery:QUERY-PREPARE("FOR EACH " + hb:NAME).
    /* Open the query */
    hQuery:QUERY-OPEN.
 
Top