Update display array (I4GL)
Posted in 2009
Topics: Stored Procedures & SPL, Connectivity: ESQL/C, 4GL & Embedded SQL
Hi. Informix 4GL 7.32 program: I have an ARRAY displayed on screen, but im not inside DISPLAY ARRAY or INPUT ARRAY, i have a for loop over the array where i update some fields, how can i redisplay the new values to screen ? I try: FUNCTION f_ejecutar_script() DEFINE lidx INT LET lidx = 0 FOR lidx = 1 TO mitems LET mar_items[lidx].ope_cod = lidx DISPLAY ARRAY mar_items TO sci.* SLEEP 5 END FOR END FUNCTION But when enters DISPLAY ARRAY i cant get out until hit INTERRUPT key, any idea ??
> -----Original Message----- > From: informix-list-bounces@iiug.org [mailto:informix-list- > bounces@iiug.org] On Behalf Of eferreyra > Sent: Wednesday, March 18, 2009 2:51 PM > To: informix-list@iiug.org > Subject: Update display array (I4GL) > > Hi. > > Informix 4GL 7.32 program: > > I have an ARRAY displayed on screen, but im not inside DISPLAY ARRAY > or INPUT ARRAY, i have a for loop over the array where i update some > fields, how can i redisplay the new values to screen ? > > I try: > > FUNCTION f_ejecutar_script() > DEFINE lidx INT > > LET lidx = 0 > FOR lidx = 1 TO mitems > > LET mar_items[lidx].ope_cod = lidx > DISPLAY ARRAY mar_items TO sci.* Try something like this here, instead of the display array: DISPLAY mar_items[lidx].* TO sci[lidx].* --EEM > SLEEP 5 > > END FOR > END FUNCTION > > But when enters DISPLAY ARRAY i cant get out until hit INTERRUPT key, > any idea ?? > _______________________________________________ > Informix-list mailing list > Informix-list@iiug.org > http://www.iiug.org/mailman/listinfo/informix-list
How about: FUNCTION f_ejecutar_script() DEFINE lidx INT LET lidx = 0 FOR lidx = 1 TO mitems LET mar_items[lidx].ope_cod = lidx END FOR DISPLAY ARRAY mar_items TO sci.* BEFORE DISPLAY EXIT DISPLAY END DISPLAY SLEEP 5 END FUNCTION Regards, Bryce Stenberg. "eferreyra" <eferreyra@gmail.com> wrote in message news:a99343ae-99db-4b57-957e-f7f80c75d603@z1g2000yqn.googlegroups.com... > Hi. > > Informix 4GL 7.32 program: > > I have an ARRAY displayed on screen, but im not inside DISPLAY ARRAY > or INPUT ARRAY, i have a for loop over the array where i update some > fields, how can i redisplay the new values to screen ? > > I try: > > FUNCTION f_ejecutar_script() > DEFINE lidx INT > > LET lidx = 0 > FOR lidx = 1 TO mitems > > LET mar_items[lidx].ope_cod = lidx > DISPLAY ARRAY mar_items TO sci.* > SLEEP 5 > > END FOR > END FUNCTION > > But when enters DISPLAY ARRAY i cant get out until hit INTERRUPT key, > any idea ??
Everett suggestion works perfect! thanks Bryce: my intention is the user see the progress by the update of the display array, its a long batch background work. the FOR i post its just a simple simulation. i update several columns. Anyway Thanks for your time, im not a english speaker so sometimes my posts arent very readables. :) Anyone can say me if in the screen there is only 10 items of a 100 array, how can i "scroll down" programatically so i can show current item always ?
> -----Original Message----- > From: informix-list-bounces@iiug.org [mailto:informix-list- > bounces@iiug.org] On Behalf Of Enrique Ferreyra (Pachu) > Sent: Thursday, March 19, 2009 6:19 AM > To: informix-list@iiug.org > Subject: Re: Update display array (I4GL) > > Everett suggestion works perfect! Thanks > > Bryce: my intention is the user see the progress by the update of the > display array, its a long batch background work. > the FOR i post its just a simple simulation. i update several columns. > Anyway Thanks for your time, im not a english speaker so sometimes my > posts arent very readables. :) > > Anyone can say me if in the screen there is only 10 items of a 100 > array, how can i "scroll down" programatically so i can show current > item always ? Now that I know what you want to achieve and that your screen array size is ten: FUNCTION f_ejecutar_script(start_rec) DEFINE lidx INT, start_rec INT IF ( start_rec > mitems - 10 ) THEN LET start_rec = mitems - 10 END IF FOR lidx = 1 TO 10 LET mar_items[lidx + start_rec].ope_cod = lidx DISPLAY mar_items[lidx + start_rec].* TO sci[lidx].* END FOR END FUNCTION Just call it every time you want to add a new record. --EEM > > _______________________________________________ > Informix-list mailing list > Informix-list@iiug.org > http://www.iiug.org/mailman/listinfo/informix-list