Re: Using arrow keys as input...
Posted in 1994
I have changed Madavan's suggestion a bit, so the dummy field (x) is eliminated. -------- tst1.per ------- database FORMONLY screen { [a0 ] } end attributes a0 = formonly.dates; end -------- tst1.4gl ------- main define dtarr array[4] of date define idx,max_no integer define dates date 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 options input wrap open window tst1 at 10,10 with form "tst1" attribute(border,prompt line last,form line first) let idx = 1 let dates = dtarr[1] input by name dates without defaults after field dates if fgl_lastkey() = fgl_keyval("return") then exit input end if if fgl_lastkey() = fgl_keyval("down") and idx < max_no then let idx = idx + 1 end if if fgl_lastkey() = fgl_keyval("up") and idx > 1 then let idx = idx - 1 end if let dates = dtarr[idx] display by name dates end input display "selected date = ",dates end main -------- END ------------- -- ----\\ Pro Informatic Aps. Niels Berner <berner@proinf.dk> | O | Jagtvej 111A, DK-2200 Copenhagen N. Denmark +-|-/ Phone: +45 35 82 36 36 Fax: +45 35 82 36 37 | | #include <disclaimer.h>