Re: assignment in on key lost
Posted in 1994
wstrutin@mars.CSEE.Lehigh.Edu (Wendy Strutin) writes: >has anybody had this happen to them? >platform: hp >version: 4.12.uc1 (or ud1)... 4.11 does not do this. no other version on > any other platform seems to do this. (SE) >code looks something like this: >let variable = 1 >input by name variable > on key (control-t) > let variable = variable + 1 > display variable { displays as 2} > sleep 5 > before field variable > display variable {displays as 1} > > after field variable > display variable {displays as 1, even though i have typed ^t, > and i am sure it executed it} > > >here's what happens. if i display variable before the ON KEY, it is 1. >if i display it during the OK KEY, it is 2. as soon as it leaves the >ON KEY it is 1 again. it's like informix is not passing back the >value of variable. yukko. >anybody else have this happen? >i haven't called informix yet, but they will no doubt deny that it >is a bug.. after keeping me on the phone for an hour. At risk of being accused of denying a bug, and of keeping you on internet hold for a couple days, your code indicates expected behavior. Since you were in the field when you hit control-t, you need to let the buffer know about the change. Try this: >let variable = 1 >input by name variable > on key (control-t) > let variable = variable + 1 > display variable { displays as 2} > sleep 5 NEXT FIELD variable By re-entering the field, the buffer will know about the change. In the more general case, you can: ON KEY (CONTROL-T) LET variable = variable + 1 IF INFIELD(variable) THEN NEXT FIELD variable ELSE DISPLAY BY NAME variable END IF If *this* doesn't work, then I'll blame a bug. ============================================================ Dennis J. Pimple Informix Software Inc Senior Consultant Denver Colorado USA dennisp@informix.com Voice:303-850-0210 Fax:303-779-4025