Re: Using arrow keys as input...
Posted in 1994
Topics: Stored Procedures & SPL, Connectivity: ESQL/C, 4GL & Embedded SQL, Migration, Import/Export & Data Conversion
Hello john, This may not be the interface you are looking for, but i am giving a sample code which displays an array of dates in a field , one at a time , by the way the user presses the arrow key (Up/Down). The user can select a dte by pressing the Return key. The overhead here is to waste a dummy field (x) to get the input from the user. -------- tst.per ------- database FORMONLY screen { [x][a0 ] } end attributes x=FORMONLY.x,invisible,autonext; a0 = formonly.dates,noentry; instructions DELIMITERS " " end -------- tst.4gl ------- main define dtarr array[4] of date define idx,max_no integer define x char(1) let dtarr[1] = "01/01/93" let dtarr[2] = "02/01/93" let dtarr[3] = "03/01/93" let dtarr[4] = "04/01/93" let max_no = 4 open window xyz at 10,10 with form "y" attribute(border,prompt line last,form line first) let idx = 1 input by name x before input display dtarr[idx] to dates after field x if fgl_lastkey() = fgl_keyval("return") then exit input end if if fgl_lastkey() = fgl_keyval("down") then let idx = idx + 1 end if if fgl_lastkey() = fgl_keyval("up") then let idx = idx - 1 end if if idx < 1 then let idx = 1 end if if idx > max_no then let idx = max_no end if display dtarr[idx] to dates next field x end input display "selected date = ",dtarr[idx] end main -------- END ------- +---------------------------+--------------------------+ | G.T.Madavan, | e-mail: gtmad@smi.mn.org | | Systems Migration Inc., | Phone : (612) 890-0040 | | Burnsville, MN, U.S.A | Fax : (612) 890-0966 | +---------------------------+--------------------------+ Disclaimer: The author's opinions are his own, and not necessarily those of Systems Migration Inc.