I'm guessing that @S1OPT is not really an 'indicator'? Indicators can only have values of '0' (*OFF) or '1' (*ON). It sounds like you have a variable that's intended to contain an option, 1=View, 2=Edit, 4=Delete.
A button, however, only has two possibilities... either it has been clicked or it hasn't. So an indicator is the natural response to a button... But the @S1OPT field doesn't seem like the right sort of field to he used as the response to a button because it isn't really an indicator.
What you could do, if you still want to use this @S1OPT field is assign actual indicators to each button, for example make indicators named btnView, btnEdit and btnDelete and bind these variables to the 'response' property of the three buttons. Then, in the RPG program you would do this:
Code: Select all
select;
when btnView = *on;
@S1OPT = '1';
when btnEdit = *on;
@S1OPT = '2';
when btnDelete = *on;
@S1OPT = '4';
other;
@S1OPT = ' ';
endsl;
Though, of course, depending on how your code was written, it may be better/nicer to just change the rest of the program to look fo the btnView, btnEdit and btnDelete values directly and remove the @S1OPT field completely.
Also, because this is in a subfile, you'll need to turn the values off again and update the subfile so the buttons are not "stuck on". Youl'd do that with some code like this:
Code: Select all
btnView = *off;
btnEdit = *off;
btnDelete = *off;
update MYSFLREC;