Informix "input array"
Posted in 1999
Topics: General Discussion
I have an array of 20 records (define arrX array[20] of int). I also have an Informix form showing 10 records of this array (screen array sa_arrX[10](fldName). I am accually using 15 records of my array, and I want the "input array" statement to prevent the user of the form from moving beyond the 15th record. Is there anyway to do this. I tried few things like: after row if arr_curr > 15 next field previous # this is just pseudo code or ... before row, before and after field xx if arr_curr > 15 next field previous # this is just pseudo code Any ideas? -----------== Posted via Deja News, The Discussion Network ==---------- http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
Sorry, it seems there's no way to dynamically restrict the input array to a subset of a whole array. I'm only using I4gl release 4.10 and array management in this language is very poor. lyassa@my-dejanews.com wrote: > I have an array of 20 records (define arrX array[20] of int). I also have an > Informix form showing 10 records of this array (screen array > sa_arrX[10](fldName). > I am accually using 15 records of my array, and I want > the "input array" statement to prevent the user of the form from moving > beyond the 15th record. Is there anyway to do this. I tried few things like: > > after row > if arr_curr > 15 next field previous # this is just pseudo code > > or ... > > before row, before and after field xx > if arr_curr > 15 next field > previous # this is just pseudo code > > Any ideas? > > -----------== Posted via Deja News, The Discussion Network ==---------- > http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
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 Good luck... Rob Vorbroker
See http://www.iiug.org/techinfo/faq/faq_top.html, which documents exhaustively ways to prevent going beyond a certain row. It takes a bit of coding, but you can loop back to the top row, or remain in the lowest row you want to go. Laurent COLLIGNON wrote in message <36FB3D1C.D43313A8@imsii.fr>... >Sorry, it seems there's no way to dynamically restrict the input array to a >subset of a whole array. I'm only using I4gl release 4.10 and array management >in this language is very poor. > >lyassa@my-dejanews.com wrote: > >> I have an array of 20 records (define arrX array[20] of int). I also have an >> Informix form showing 10 records of this array (screen array >> sa_arrX[10](fldName). >> I am accually using 15 records of my array, and I want >> the "input array" statement to prevent the user of the form from moving >> beyond the 15th record. Is there anyway to do this. I tried few things like: >> >> after row >> if arr_curr > 15 next field previous # this is just pseudo code >> >> or ... >> >> before row, before and after field xx >> if arr_curr > 15 next field >> previous # this is just pseudo code >> >> Any ideas? >> >> -----------== Posted via Deja News, The Discussion Network ==---------- >> http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own > > >