Re: Help for handle "Input Array"
Posted in 1998
On Fri, 11 Sep 1998 10:04:53 -0400, "Art S. Kagel" <kagel@bloomberg.net> wrote: >CheungYip San wrote: >> >> Hello all informix 4GL users, >> >> I am writing the Informix 4GL program and try to >> using the "Input Array" to display and modify the >> program array on the screen. >> >> But I don't know how to control the program to stay >> on the last item of program array. Since the cursor >> will move to a new blank row after the user press >> the <Down> or <Enter> key at the last containing >> data row. >> >> This program just only use to modify the existing >> data, I won't want the user to insert any new >> row to the array. > >If memory serves, I believe you want to do a NEXT FIELD to the last >field in the record in a BEFORE INSERT or BEFORE ROW section if the >row is NULL. Do not forget to disable the INSERT key and DELETE keys >so the user cannot insert new rows between others or delete existing >rows in the array. This will not work. You would be left on that an empty row after the last displayed and couldn't move away unless you typed in something. 1. You must do it in after row (there is no need to do it after insert as you have dissabled the insert and delete keys as Art has correctly stated). 2. You can use next field to any field. The common one would be the first. 3. You should test for the same counter variable you use to in the set_count functioncall just before the input array to find out if you are on the last row or not. 4. You also have to test for the up arrow key being the last key using something like if fgl_lastkey() = fgl_keyval("up") then and not do the next field in this case. Otherwise the user can't move up again. 5. You may have to test for other values for the last key like "prevpage" and probably "accept", "esc" and possibly others to make sure every case works properly. I don't remember off hand all the effects here so you have to simply test all these and others you might be able to think of. (No "prevpage" test has the same effect as no "up" test when the user hits the page up key and "accept" and/or "esc" are needed for the accept key to work properly. (If your accept key isn't esc you may have other effects in this regard.) Nils Myklebust NM Data AS Norway E-mail: Nils.Myklebust@nmdata.com FAQ at: http://www.iiug.org/techinfo/faq/faq_top.html (Now with ODBC info under "Third party products".)