Re: move x number of records in 4gl
Posted in 2000
How do you store the results of the query? We save only the serial number (or rowid) of the records returned by the query in an array, then when a user types 10N (10 Next) or 5P (5 previous) at the Menu, we move a pointer that many positions in the array, grab the id, and then do a fetch of that one record. This technique is based on Dave Snyder's 4GL-program generator program, so if you had used that as the basis of your programs, the code would be in all your programs. Austin Castro wrote: > > This solution is what my other collegue had in mind but we have many > programs in which some of our top managers want this in, so........., is > there any way to implement this solution in a shared object library > function. This would significantly reduce coding. > > Austin > >Austin Castro wrote: > >> > >> Hi Guys, > >> Is there a function in 4gl to move x amount of records in the fetch list > >> where x represents a number pressed by user like there is in a perform > >> screen. If not, can any body give me any ideas as to how I can implement > >> such a facility. I'm thinking about having a menu options which prompt > >> for the number of rows to move forward of backward but that seems to be > >> clumsy. > >> > >> Thanks > >> Austin > > > >We use the "COMMAND KEY" Menu options to build up a number, then use that > >number when the function called when users press "Next" or "Previous" menu > >options. (The "Command Key" options don't show up on the screen) > > > > COMMAND KEY ("0") > > WHENEVER ERROR CONTINUE > > LET q_off = q_off CLIPPED, "0" > > WHENEVER ERROR CALL error_sql > > > > COMMAND KEY ("1") > > WHENEVER ERROR CONTINUE > > LET q_off = q_off CLIPPED, "1" > > WHENEVER ERROR CALL error_sql > > > > COMMAND KEY ("2") > > ... -- Colin