Re: Updating screen rows in INPUT ARRAY (fwd)
Posted in 1996
Robert Minter writes: * From rob Mon Apr 1 13:46:31 1996 * Subject: Re: Updating screen rows in INPUT ARRAY * To: ana.med.uni-muenchen.de!spitz@uunet.uu.net * Date: Mon, 1 Apr 1996 13:46:31 -0800 (PST) * From: Robert Minter <rob> * In-Reply-To: <Pine.A32.3.91.960401103939.20116B-100000@vth4.vth.colostate.edu> from "Con Woodall" at Apr 1, 96 10:55:55 am * X-Mailer: ELM [version 2.4 PL2] * Content-Type: text * Content-Length: 3049 * * * Dear fellow Informixers, * * * * I need a solution for the following problem in I-4GL (4.1x): * * * * We have an INPUT ARRAY session where some fields cannot be updated * * within this session, because they must be the same for all rows with * * a common date. Currently we let the user update these fields by pressing * * "F9", which calls a function with an INPUT statement to edit these * * values. On return, the new values are displayed to the current row * * only. * * * * How can I change the code so all rows for that date are updated on the * * screen? I've done this in other programs by embedding the INPUT ARRAY * * in a WHILE loop, exiting the INPUT array session, updating the data * * and loop back into the INPUT array. The problem is putting the cursor * * back to the row that was just being processed, and the kludgy solution * * to this (working with a NOENTRY field/NEXT field combination) was not * * liked by the users. * * * * Is there any other way to update rows within an INPUT array session? * * * * Regards, Richard * * -- * * +----------------------------+-------------------------------------------+ * * | Dr. Richard Spitz | INTERNET: spitz@ana.med.uni-muenchen.de | * * | EDV-Gruppe Anaesthesie | Tel : +49-89-7095-3413 | * * | Klinikum Grosshadern | FAX : +49-89-7095-8886 | * * | 81366 Munich, Germany | | * * +----------------------------+-------------------------------------------+ * * If you want to let them edit in place and update all the other rows based * on some date field, try something like the following: * * DEFINE * idx, jdx, scrn_line, curr_row INTEGER, * number_of_screen_rows SMALLINT, * tmp_value CHAR(80) * * BEFORE FIELD global_field_by_date * LET curr_row = arr_curr() * LET scrn_line = scr_line() * LET tmp_value = array[curr_row].global_field_by_date * * AFTER FIELD global_field_by_date * IF tmp_value <> array[curr_row].global_field_by_date THEN * LET tmp_value = array[curr_row].global_field_by_date * FOR idx = 1 TO arr_count() * IF array[idx].date_field = array[curr_row].date_field THEN * LET array[idx].global_field_by_date = tmp_value * END IF * END FOR * LET jdx = curr_row - scrn_line + 1 * FOR idx = 1 TO number_of_screen_rows * IF jdx > arr_count() THEN * EXIT FOR * END IF * DISPLAY array[jdx].* TO sa_array[idx].* * LET jdx = jdx + 1 * END FOR * END IF * * Thanks, ----------------------------------------------------------------------------- Robert Minter Data Systems Support Senior Software Engineer A Client Technologies Company E-Mail: rob@dssmktg.com Tel: 714.771.0454 #include <disclaimer.h> Fax: 714.771.3028 De Colores - Emmaus OC-13 http://www.dssny.com