Re: ON KEY with EXIT INPUT: loosing field data
Posted in 1995
Bruce Momjian (root@candle.pha.pa.us) wrote: : ... : However, I have run into the problem described in the INPUT manual page. : The ON KEY command expects to return to the current field. Because my : ON KEY contains an EXIT INPUT statement, any data changes in the current : field are discarded when the EXIT INPUT is done. If you have version 4.10 or higher, you can use get_fldbuf() to get your desired results. It's documented in the 4GL Supplement page 68: ON KEY (whatever) LET r_table.* = get_fldbuf(scr_record.*) EXIT INPUT Or something like that. : The manual says that I can do a NEXT FIELD to another field to keep the : changed data. I tried that, but it only works if the cursor actually : lands in the new field. Doing a NEXT FIELD and then a BEFORE FIELD : containing an EXIT INPUT does not save field changes. The problem is I : can not actually land in another field because the function key press is : supposed to take me to another form. NEXT FIELD within the ON KEY statement has the same problem as EXIT INPUT; it causes the curosr to leave the field before the program variable is filled from the field buffer is read. The only pre-4.1 solution I ever came up with is to set a flag, give a message "Type RETURN to exit", and then test the flag in AFTER FIELD control blocks. You could do something fancy via terminal settings and termcap whereby the function key is sending the appropriate f-key signal *plus* a return, but it would be a maintenance headache. ======================================================================= Dennis J. Pimple dennisp@informix.com Opinions expressed Senior Consultant -------------------- are mine, and do not Informix Software Inc Voice: 303-850-0210 necessarily reflect Denver Colorado USA Fax: 303-779-4025 those of my employer.