Re: Display Arrays
Posted in 1994
dlaskey@xyplex.com writes: >Is there any way to use a Display Array statement to fill a screen record from >a program array with out having the control default to the user. I am trying >to refresh the screen record from a modified program array and when I use this >statement >'display array prog_array into screen_record.*' >it waits for the user to hit the ACCEPT key before the user is returned to the >menu. What I would like to have happen is that the screen is refreshed and the >user is placed at the menu (basically just eliminating the need for the user >accepting the refresh by hitting the escape key). What you want is DISPLAY ... TO instead of DISPLAY ARRAY. Implied here is that there is never > 1 screen's worth of rows retrieved. Here's an example of how I would display 1 screen's worth of data, and what I would do if more than 1 screen's worth were to be fetched: LET arr = 0 FOREACH cursor INTO l_table.* LET arr = arr + 1 LET ma_array[arr].* = l_table.* IF arr <= max_screen_size THEN DISPLAY ma_array[arr].* TO s_array[arr].* END IF END FOREACH IF arr > max_screen_size THEN DISPLAY "Use arrows & paging keys to view, ESC to exit" AT 1,1 CALL set_count(arr) DISPLAY ARRAY ma_array TO s_array.* DISPLAY "" AT 1,1 LET int_flag = FALSE END IF MENU "... ======================================================================= Dennis J. Pimple dennisp@informix.com Opinions expressed Senior Consultant -------------------- are mine, and do not Informix Software Inc Voice: 303-850-0210 necessarily reflect Denver Colorado USA Fax: 303-779-4025 those of my employer.