Re: Readonly input and pick a value from listoptions.

Chad Lemmen <[email protected]> Tue, 2 Jan 2024 17:26:21 -0500 (EST)
Newsgroups gmane.comp.lang.4gl.aubit.general
Message-ID <[email protected]>
> Is it possible to set readonly input that only allows pressing CONTROL-B 
> to show list of options in Aubit4GL (not allow user to input just pick 
> a value from lists available)?

Iwan,

You could use 'on key(control-b)' that will run a 'display array' to show 
a list of options. The user can then select one of the options. This is 
not tested, but something like this:

define lv_str char(10)

input lv_str from form_field
   on key(control-b)
     call display_array()
end input

function display_array()
   define lv_disp_arr array[12] of char(80)

   let lv_disp_arr[1] = "option 1"
   let lv_disp_arr[2] = "option 2"

   open window w1 at 9,15 with form "options" attribute(border)
   display array lv_disp_arr to sa.* attribute(current row 
display="reverse")

    on key (accept,return)
      let lv_a=arr_curr()
      exit display
    close window w1

   return lv_disp_arr[lv_a]
end function