Re: 4GL Q: Popup window from within Construct statement
Posted in 1993
manmetha@gauss.rutgers.edu (Rajesh Malhotra) writes: > A question on the construct statement in 4GL. > I am creating the where clause of a select using construct, >but when the cursor goes to a particular field, I want to throw up >a window and let the user select one of the available values. How >would I do this from within construct? > From within INPUT ARRAY, I can do this using the ON KEY and >the INFIELD() function, figure out which field the cursor is on, and >throw up a Window and let the user pick one value from a list. > Is it possible to achieve the same functionality from within >a construct statement? As someone else responded, you SHOULD be able to do it the same with version 4.1 of 4GL, but you will probably run into bug #14985 the following should work: ON KEY (...) CASE WHEN INFIELD(somefield) # call a function to pick a value LET disptxt = do_pick("D") # put that value in the field DISPLAY disptxt TO screen_record.somefield ... END CASE What happens is, as page S-88 of the 4GL 4.1 SUPPLEMENT tells us, on an ON KEY clause, the current input buffer is saved and restored for the current screen field after the clause is executed. Apparently, the bug addresses the problem that there seems to be no way to overwrite the saved buffer, as the DISPLAY statement above should. I just stummbled across this myself yesterday, so I'll try a coupld workarounds I have in mind and post if I find anything. ================ Dennis J. Pimple Informix CSE / Denver