We have a piece of code thus:
FUNCTION f_3opt(f_3_n1,f_3_o1,f_3_c1,f_3_n2,f_3_o2,f_3_c2,f_3_n3,f_3_o3,f_3_c3)
DEFINE
f_3_n1,f_3_n2,f_3_n3 CHAR(35),
f_3_o1,f_3_o2,f_3_o3 CHAR(1),
f_3_c1,f_3_c2,f_3_c3 CHAR(19),
f_ans CHAR(1)
LET f_ans=NULL
MENU f_ans
ATTRIBUTE(STYLE="dialog",COMMENT="Please choose",IMAGE="question")
COMMAND f_3_n1 f_3_c1
LET f_ans=f_3_o1
EXIT MENU
COMMAND f_3_n2 f_3_c2
LET f_ans=f_3_o2
EXIT MENU
COMMAND f_3_n3 f_3_c3
LET f_ans=f_3_o3
EXIT MENU
END MENU
RETURN f_ans
END FUNCTION
Whilst this works in most conditions, if the function is called like this:
...
CALL f_3opt('Change','C','Change the entry','Accept','A','Accept the Entry','Quit','Q','Quit') RETURNING l_onecharvar
...
Then we get the result that if the keyboard is used to select the item and the <Return> or <Enter> key is used, the Accept option is ALWAYS triggered (obviously).
Would an extra ON ACTION accept ... clause in the menu trap the Accept key, and if so how would we detect the 'selected' item from the menu ?
Would the DIALOG.getfieldtouched() method do the trick?
For the moment I have amended the application to rename these menu options.
Thanks for any advice.