Check if there is a radio-set in the window

Steegmans Ruben

New Member
Is there any possible way to check if there is a radio set in a window?

I have defined an include in a window,
and I want to check in that include if there is a radio set present in that window. :confused:

Is it possible to do that??

thanx in advance.
Ruben.
 
Hello Ruben,

It's a solution (I think) but I don't know if you want to use it. You have to decide.

If you use {&WINDOW-NAME}:FIRST-CHILD you're in the frame. Use FIRST-CHILD again to access the field group.
If you walk through all the widgets in your field group using NEXT-SIBLING and check the TYPE attribute you should find out if there is a radio set present.

ASSIGN v-hdl = {&WINDOW-NAME}:FIRST-CHILD /* FRAME */
v-hdl2 = v-hdl:FIRST-CHILD /* FIELD GROUP */
v-hdl3 = v-hdl2:FIRST-SIBLING. /* first widget in FG */

DO WHILE VALID-HANDLE(v-hdl3) :
IF v-hdl3:TYPE = 'RADIO-SET' THEN ...
v-hdl3 = v-hdl3:NEXT-SIBLING.
END.

Good luck,
Henri
 
You might want to do this recursively using a procedure.

RUN p-Parse(INPUT {&WINDOW-NAME}:FIRST-CHILD).

PROCEDURE p-Parse.

DEF INPUT PARAM ip-Handle AS HANDLE NO-UNDO.

DO WHILE VALID-HANDLE(ip-Handle):
IF ip-Handle:TYPE EQ "RADIO-SET" THEN
MESSAGE ip-Handle:NAME "is a radio set".

IF CAN-QUERY(ip-Handle,"FIRST-CHILD") THEN
RUN p-Parse(INPUT ip-Handle:FIRST-CHILD).

ASSIGN ip-Handle = ip-Handle:NEXT-SIBLING.

END. /* do while true */

END PROCEDURE.
 
Top