looping trough parsed default-buffer-handle

Faitie

New Member
The tool i build consists of 2 windows. The first(main) displays the content of a table.
When i want to add a record to the table i open a 2nd window(the add window) there i can fill in the field that will populate that record.
Now when i open my 2nd window I parse the the default-buffer-handle to it from my main program like this.


RUN 30beh/30beh_konfunktie_add.w(INPUT brOverview:HANDLE, INPUT "Add", INPUT TEMP-TABLE ttKonfunktie:DEFAULT-BUFFER-HANDLE).


now i would like to loop over all the records that i get from that default-buffer-handle, but i can't seem to figure out how.
I got it defined in my 2nd window like hanKonfunktie.


DEFINE INPUT PARAM hanKonfunktie AS HANDLE NO-UNDO.


And when i try to use it in a repeat i get the syntax error that he can't find what he is looking for.


my question to you guys is. How can i acces hanKonfunktie so i can itterate over all the data.
 

Faitie

New Member
solved my problem, i used this to fix it.

Code:
DEF VAR bhKonFunc AS HANDLE NO-UNDO.      /* making handles */
DEF VAR qhKonFunc AS HANDLE NO-UNDO.     /* making handles */


CREATE QUERY qhKonFunc.
qhKonFunc:ADD-BUFFER(hanKonfunktie).        /*adding the default-buffer-handle from window 1 to the query*/




qhKonFunc:QUERY-PREPARE(SUBSTITUTE("for each &1" , hanKonfunktie:NAME)). /*preparing the query*/


qhKonFunc:QUERY-OPEN().
qhKonFunc:GET-FIRST().
REPEAT WHILE NOT qhKonFunc:QUERY-OFF-END:
    IF hanKonfunktie::rpnaam MATCHES("*" + txtRoepnaam:SCREEN-VALUE + "*") THEN DO: /*using the match function */
        slctVoorstel:ADD-FIRST(hanKonfunktie::rpnaam).
    END.
    qhKonFunc:GET-NEXT().
END.


qhKonFunc:QUERY-CLOSE().
 
Top