Re: Question on Input Array ..
Posted in 1994
balaji@myria.cs.umn.edu (S.Balaji) writes: >Hi All, > I need to incorporate a special feature in my input array >statement : on reaching the last row, I want to display a message 'There are >no more rows in the direction you are going'. In the display array statement >informix automatically provides this. How to do this in input array statement ? >I need this because I want to provide an 'update only' form to the user - where >some rows are queried, and the user can update them - but they should not be >allowed to go beyond the last row. >The way I'm trying to do this is as follows : > input array .... > on key(down) > let arr_pos = arr_curr() > if arr_pos > count { I have captured count earlier in my foreach } > then > error 'There are now more rows bla bla ..' > else > scroll down by 1 > > end input >This is not exactly working ..dont know why ..maybe it is actually going to the >next row, but I have to manually display the row on screen ? By the way, I am >displaying only one row on the screen at a time. I think you're real close, but instead of an ON KEY statement, I'd try fgl_lastkey() testing in AFTER ROW. Something like: AFTER ROW LET lkey = fgl_lastkey() IF arr = count AND (lkey = fgl_keyval("DOWN") OR lkey = fgl_keyval("NEXT") OR ...) THEN ERROR "No more rows ..." END IF The only problem with this is you have to decide what to do with the user if indeed they try a down arrow from the last row. I suggest wrapping them back to the top, so we use our "goto loop" input array, which has been discussed here before. Let me know if you need details. ======================================================================= 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.