ON KEY WITH EXIT INPU
Posted in 1995
D> From: dennisp@informix.com (Dennis Pimple) D> Bruce Momjian (root@candle.pha.pa.us) wrote: > : ... D> : 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. D> 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: D> ON KEY (whatever) > LET r_table.* = get_fldbuf(scr_record.*) > EXIT INPUT D> Or something like that. I would suggest the "something like that" if you are using an INPUT WITHOUT DEFAULTS. If I remember correctly, there are 2 possible problems with using the get_fldbuf(record.*). One problem is that a field that had something to start can have it blanked out if the cursor never entered that field. The other problem is that a NULL field becomes a blank-filled field. I usually do something more like: ON KEY (whatever) IF infield(field1) THEN LET r_table.field1 = get_fldbuf(scr_record.field) IF r_table.field1 = " " THEN LET r_table.field1 = NULL END IF ELSE . . . Or use a case statement if there are quite a few fields. --- ~ SPEED 1.40 [NR] ~