JSS
JSS

Reputation: 27

How to test for an item in a radio set

In OpenEdge Progress, I want to add an item to a radio set, but first I want to test to make sure that it is not already there so it won't be duplicated. Is there a better way to do this other than :

dummy-log = radioset:delete(value) no-error. dummy-log = radioset:add-last(label,value).

Using :delete causes issues if the current record has this as a screen value.

We use OpenEdge Release 10.2B05.

Upvotes: 0

Views: 502

Answers (1)

TheDrooper
TheDrooper

Reputation: 1217

The RADIO-BUTTONS attribute gives you the label/value pair list for the radio set. You can then look for the value in it before adding a new one.

IF LOOKUP(value, radioset:RADIO-BUTTONS) = 0 THEN
    dummy-log = radioset:add-last(label,value).

Upvotes: 2

Related Questions