Skip to main content
Question

Radio-Buttons with occurs

  • November 19, 2025
  • 2 replies
  • 24 views

Andreas Weinand
Forum|alt.badge.img+2

We love that you can use OCCURS in the screen section and we use it quite frequently.

Now - for the first time - we need a radio-button that gets its options from a table and we don’t know how to get the value.

This is what we would like to use:

78            T01-MAX           VALUE 10.
78 T01-GROUP VALUE 03.

01 T01-RESULT PIC 9(02).

01 T01-TABLE.
02 T01-RECORD OCCURS T01-MAX
INDEXED BY T01.
03 T01-VI PIC 9(01).
03 T01-ID PIC 9(05).
03 T01-TITLE PIC X(40).
03 T01-VALUE PIC 9(02).



01 SCRPP10-BILD.
02 LABEL LINE 10 VISIBLE 0.
02 OCCURS T01-MAX.
03 RADIO-BUTTON LINE + 1
COL 50
VISIBLE T01-VI
ID T01-ID
TITLE T01-TITLE
GROUP T01-GROUP
GROUP-VALUE T01-VALUE
VALUE T01-RESULT.

But this gives us a “Mismatching OCCURS structure” error - probably because T01-RESULT is not part of the table.
We tried a lot of solutions but none of these worked.

Does anyone use radio-buttons with OCCURS ?

2 replies

Claudio Contardi
Forum|alt.badge.img+2

@Andreas Weinand , I think this is explained in the Documentation at:

Home
extend Interoperability Suite 11.0.0
extend Interoperability Suite
ACUCOBOL-GT Version 11.0.0 Documentation Set
ACUCOBOL-GT User Interface Programming
Control Types Reference
Control Types
Radio Button
Common Properties
https://docs.rocketsoftware.com/bundle/acuextendsuite_ug_1100/page/ipg1742856169369.html

VALUE

Radio buttons have numeric values. A value of 0 indicates an unselected radio button. A value of 1 indicates a selected radio button.

Note: Radio buttons cannot have array elements in a VALUE or USING phrase. The compiler detects and disallows such usage, and an error message is displayed at compile time.

 

You can define “... VALUE 0”  in your OCCURS, and then define which item has to be displayed as selected (VALUE 1). This because only one item of the Radio Button can be selected.

Regards.


Andreas Weinand
Forum|alt.badge.img+2
  • Author
  • Participating Frequently
  • November 19, 2025

First of all: sorry for the messy source, it was perfecty aligned when I sent it.

Under “Special properties” the guideline says:

GROUP-VALUE (numeric)

This property simplifies the process of managing a group of radio buttons. Normally, the program must determine which button in a group is selected by examining the value of each button. The button with a value of 1 is the selected button. The GROUP-VALUE property is used to turn the value checking process into a single operation. You assign each radio button in a group a distinct GROUP-VALUE number. This links each button with its corresponding GROUP-VALUE. In this way, you can determine which button is selected by assigning all of the buttons in the group the same VALUE data item. The data item will hold the GROUP-VALUE number of the selected radio button.

And that’s what I tried with my “VALUE T01-RESULT”.
T01-RESULT is on level 01 outside of the table, so only one radio-button in the group can be selected and IMHO it should work.

Or am I missing something ?