Re: Informix "input array"
Posted in 1999
Topics: Stored Procedures & SPL, Connectivity: ESQL/C, 4GL & Embedded SQL
Eric, Coleman, Informix, Tech, Support wrote: > > If all you want the user to do is to see the rows and not have the > ability to add or update the rows, then use DISPLAY ARRAY instead of > INPUT ARRAY. This will limit the user to only the number of rows you > specify with the call to SET_COUNT() before the DISPLAY ARRAY clause. Also, both Dynamic 4GL 3.0 and Classic 4GL 7.3 (due out around the end of 2Q99) will have direct support for this. D4GL already allows you to position the cursor both within the program array and the screen array; Classic 4GL will also catch up on this in 7.3. I'll try not to say "and about time too!" too gleefully. -- Jonathan Leffler (jleffler@informix.com, jleffler@earthlink.net) Guardian of DBD::Informix v0.60 -- see http://www.perl.com/CPAN #include <disclaimer.h> > On Fri, 26 Mar 1999 15:32:38 GMT, "robertb..vorbroker" > <robertb..vorbroker@cwix.com> wrote: > > > > >You can limit the input array to the 15 (or rows loaded from DB) however > >when the user hits the downarrow, tab or enter from within the last row the > >program can put them back in the first row of the array. > > > > > >The following is psuedo 4GL off the top of my head so you may need > >to debug... NOTE: you will also have to set INSERT and DELETE KEYs to > >bizarre or unconventional key stroke commands... > > > >DEFINE lv_last SMALLINT, > > lv_num_rows SMALLINT > > > >Load data into array setting lv_num_rows to correct # (in this case 15)... > > > >LET lv_last = TRUE > >WHILE (lv_last) > > LET lv_last = FALSE > > CALL SET_COUNT(lv_num_rows) > > INPUT ARRAY la_array WITHOUT DEFAULTS from sa_array.* > > BEFORE ROW > > LET lv_curr_row = ARR_CURR() > > IF lv_curr_row > lv_num_rows THEN > > LET lv_last = TRUE > > EXIT INPUT > > END IF > > END INPUT > >END WHILE
Jonathan Leffler wrote: > Eric, Coleman, Informix, Tech, Support wrote: > > > > If all you want the user to do is to see the rows and not have the > > ability to add or update the rows, then use DISPLAY ARRAY instead of > > INPUT ARRAY. This will limit the user to only the number of rows you > > specify with the call to SET_COUNT() before the DISPLAY ARRAY clause. > > Also, both Dynamic 4GL 3.0 and Classic 4GL 7.3 (due out around the > end of 2Q99) will have direct support for this. D4GL already allows > you to position the cursor both within the program array and the > screen array; Classic 4GL will also catch up on this in 7.3. Or there's the standard (messy and long) workaround that allows you to move the cursor up and down at will -- add an invisible noentry one-position field at the beginning and end of each row. Do a succession of NEXT/PREVIOUS rows and put your 'when to stop' logic in the hidden fields. Hey, I said it was messy. -Richard