Re: Can I force Accept key thru i4gl?
Posted in 1997
On Thu, 6 Nov 1997, Nelson Fredsell wrote: > On Thu, 06 Nov 1997, Dennis Pimple wrote: > > |I'd advise getting away from DISPLAY ARRAY and just DISPLAY: > | > |FOR x = 1 TO rowcount > |DISPLAY myrecord[x].* TO scrrecord[x].* > |END FOR > > I gave this a try and it worked fine until I came across a record which > had more detail records than the screen could display. It then dumped me > out of the program. That's not good; it should have caused a run-time error when you tried to display to a screen record not in range (and not a core dump). > Also, I apparently had to limit my i4gl ARRAY[x] OF RECORD statement to > the SCREEN RECORD[x] form statement. No. > I'd like the user to be able to have a Detail option on the menu which > allows one to enter the detail section and scroll down beyond what is > initially visible on the 6-rows. At this point the user would have to > hit the Accept key to proceed to the next master record. What you have to do is a little complex, but perfectly doable. The initial display code needs to know how many rows are in the screen record. (Defect: you can't tell the number of rows in a screen record from inside I4GL.) The initial display loop (the code Dennis outlined) should display records 1 .. MIN(number of records to display, number of rows in screen record) If/when the user chooses the Detail option, then you run a DISPLAY ARRAY statement, and the user can scroll up and down the complete array. The main decision you have to make is when to retrieve the rows that won't be displayed on the screen unless the user chooses the detail option. You could do this before displaying anything (so you can say how many rows there are), or you could simply fetch the first 6 rows which will be visible and simply collect the rest when the Detail option is chosen. This solution doesn't force user interaction with the detail list until the user requests it. Yours, Jonathan Leffler (johnl@informix.com) #include <witticism.h>