Re: Display array
Posted in 1996
Topics: Stored Procedures & SPL, Connectivity: ESQL/C, 4GL & Embedded SQL
Nils Myklebust wrote: > > Eugeny Drokov <dei@karakan.nstu.nsk.su> wrote: > > :Nils Myklebust <Nils.Myklebust@idg.no> wrote: > :: Simply use > > :: display pgm_arr[p_count].* > :: to scr_arr[p_count].* > > :: inside a loop that increments p_count. > :: Start the counter at 1 and make sure you don't display beyond the > :: number of elements in the scr_arr screen array. > :: You can put all kinds of attributes on this display statement to make > :: your list look nice. > > :: rrela@dc.uba.ar (Ramiro Rela) wrote: > > :: :I need to display an array to an opened form and inmediatelly > :: :(without asking the user to press any key) continue the program > :: :execution. > > :: :I tried, > :: : DISPLAY ARRAY pgm_arr TO scr_arr.* > :: : EXIT DISPLAY > :: : END DISPLAY > :: : ... > > :: :but this sintaxis is not allowed. Any statement must be below an 'ON KEY > :: :key' clause. > > : I think, there is the much better solution: > > : INPUT ARRAY pgm_arr WITHOUT DEFAULTS FROM scr_arr.* > : BEFORE INPUT > : EXIT INPUT > : END INPUT > > Great. I hadn't ever thought of this. My solution is from before the > "before input" existed at all, and just used ever since. > > However there are situations where I will still use the display > approach. Often it will take an unknown amount of time to read the > data to be displayed from the database. In these cases it is very nice > to the user to display the data as it is read so they can start > looking at it. Otherwise the input array solution is greate. I agree. However, I have found that it is much wiser to stick to the fundamental commands for fundamental functionality. The INPUT ARRAY may look easier to maintain in the short-term, but is far more likely to have 'features' added, whether intentionally or not, than the DISPLAY command. If you are one of those that have seen 4GL evolve from day one, you will know that commands like DISPLAY are unlikely to have features added, whereas, commands like INPUT ARRAY, DISPLAY ARRAY, CONSTRUCT, etc have permanent 'wish lists' attached. I would rather code a couple of extra lines up front if it meant the code was more robust in the long-term. I, like most, hate maintaining old code, ....especially my own. ;-)) Of course, these days it looks as though NewEra has killed 4GL for good, so these comments may be irrelevant. ;-) (All wars on this subject invited, holy or not :-) Cheers, -- Mark. +-------------------------------------------------------------------------+ |Mark D. Stock - The West Solutions Group http://www.west.co.za | | The Informix FAQ is at http://www.iiug.org | |mailto:marks@west.co.za +------------------------------------------------+ |Tel: +27 11 803 2151 |If it doesn't work... force it! | |Fax: +27 11 803 2189 |If it breaks... it needed replacing anyway! | |Cell: +27 83 250 2325 |Well, that's how I code anyway! | +------------------------+------------------------------------------------+