Re: HELP: arrow keys and INPUT
Posted in 1994
From Todd A Bernhardt: * I have a question regarding implementing a Novell-like pop-up menu in * Informix 4gl. * * <Stuff Deleted> * You have to have a one character input routine and a form that goes along with that looks like: # ---- SNIP ---- SNIP ---- SNIP ---- SNIP ---- SNIP ---- SNIP ---- { testform.per } DATABASE FORMONLY SCREEN { [a] } ATTRIBUTES a = FORMONLY.ch, AUTONEXT; # ---- SNIP ---- SNIP ---- SNIP ---- SNIP ---- SNIP ---- SNIP ---- And within your program, you need to do the following before any displays: OPEN FORM frm_name FROM "testform" DISPLAY FORM frm_name Then display you options or list and use the following as a basis for the key logic: DEFINE ch CHAR( 1 ), ch_list CHAR( 10 ) INPUT BY NAME ch ATTRIBUTE ( INVISIBLE ) AFTER FIELD ch IF LENGTH( ch ) THEN -- Add to character list LET ch_list = ch_list CLIPPED, ch CALL move_to_row( ch_list ) -- Logic to move to a specific row END IF ON KEY ( ESC ) -- Reset character list LET ch_list = "" ON KEY ( DOWN ) CALL move_down() -- Logic to move highlighted area down ON KEY ( UP ) CALL move_up() -- Logic to move highlighted area up ON KEY ( CONTROL-M ) -- Select choice EXIT INPUT ON KEY ( INTERRUPT ) -- Abort Menu LET int_flag = 1 EXIT INPUT END INPUT Obviously, you can use whatever you want for the selection and abort keys. But, I hope you get the general idea. Robert Minter |Data Systems Support| \\\\\\_/// Programmer, Software Development | Orange, CA | ( _ _ ) internet: rob@dssmktg.com | Tel: 714.771.0454 | (| ^ |) bangpath: uunet.uu.net!dssmktg!rob| Fax: 714.771.3028 | \\`-'/ #include <disclaimer.h> \\_/