Re: Screen array problem (repost)
Posted in 1997
>From: Richard Hawkins <richh@netcomuk.co.uk> >Date: Fri, 18 Jul 1997 21:59:41 GMT >X-Informix-List-Id: <news.40616> > >I've put together a screen which basically shows seven days of >clocking information. I've used a screen array where the rows >go down the screen instead of the usual across i.e. > >MON TUE WED THU >[f000 ][f000 ][f000 ][f000 ] >[f001 ][f001 ][f001 ][f001 ] >[f002 ][f002 ][f002 ][f002 ] >[f003 ][f003 ][f003 ][f003 ] >[f004 ][f004 ][f004 ][f004 ] > >Now if the cursor is in field 'mon f0000' and I press TAB or the >right arrow, I should want it to go into the tue f000. Instead it >goes into mon f0001. This is of course correct if it was set out >as normal, f000 to the left of f0001. But in this case it isn't. >If the cursor is in wed f003 and I press the left arrow, I want it >to go into f003 tue, but it goes into f002 wed (upwards). > >I just wondered if it's possible to redefine the arrow keys within >the program. Or maybe code a way around it. I've not seen any answers of note, and I guess everyone else who might answer is at IWUC-97. Fundamentally, I think you are trying to do that which I4GL is not designed to do. An I4GL input array is designed to have the fields of each row horizontally spaced across the page. Neither the I4GL runtime nor the form compiler enforces that layout (which may be a bug of sorts), but that's what it is designed to handle. There definitely used to be field tracking bugs in the code if you don't have a clean, columnar layout for the array. Therefore, to get the behaviour you want, you will have to modify the screen layout, and the array used for the input, to match the input requirements, and then, if necessary, copy the data from the array used during input into the array used for the other processing in the program. You might need to copy the data into the array used for input if you're updating the information. MON TUE WED THU [f000 ][f001 ][f002 ][f003 ] [f000 ][f001 ][f002 ][f003 ] [f000 ][f001 ][f002 ][f003 ] [f000 ][f001 ][f002 ][f003 ] [f000 ][f001 ][f002 ][f003 ] This works provided that the data types for each row is the same, which will probably apply to your data. If the values in your f000 are different from the values in your f001, then life is much trickier. One (nasty) possibility is to input character data, and then validate the conversion to the different internal types in the after field clauses. That could be made to work, but wouldn't be particular nice. I4GL is fairly flexible, but there are certain things which it does not handle well, and changes to the input array such as you were trying are definitely outside its normal range of flexibility. Yours, Jonathan Leffler (johnl@informix.com) #include <disclaimer.h>