Re: Can I force Accept key thru i4gl?
Posted in 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. Also, I apparently had to limit my i4gl > ARRAY[x] OF RECORD statement to the SCREEN RECORD[x] form > statement. > > 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. You can do the display yourself as above but not for rowcount only say for screencount then if say down arrow means next master record and page down means next screen of detail. You would then redisplay the next screencount records from the array. If you are really swift you can even handle the event where there are more records in the table than can fit in your holding array. I have a generic screen handling library that I wrote that does just this. Just think graphically of three views or windows into the data: Screen Window: |--------------| (10 rows) Array Window : |--------------------------------| (50 rows) Table Window : |--------------------------------------------| (unlimited) Then you just slide the screen window over the array window (ie adjust the variables that control the first and last array element being displayed), refreshing the display each time, until it hits one end. Then you move the array window over the select set (adjust the variables that track which row numbers in the select set are currently in the array and either with a scroll cursor or by refetching move the next block into the Array Window) carrying the screen window along by keeping it updated. There are very few cases to handle 1) more data in Table Window than the Array Window can hold, 2) less data in Table Window than Array Window can hold in which case there could be a) more data than fits in the Screen Window or b) less data than fits in Screen Window. To keep track while coding draw a picture as above for each case and insert the appropriate variables. Hope that this helps. Art S. Kagel