Re: Help with scrolling within..
Posted in 1993
Topics: SQL Development & Query Writing, Stored Procedures & SPL, Connectivity: ESQL/C, 4GL & Embedded SQL, Triggers, Constraints & Referential Integrity
IN ARTICLE <1r2g66INNj1@emory.mathcs.emory.edu>, rridley@sin-pss.DHL.COM (Richard Ridley) WRITES: > > Re: > > >I have a question about scrolling/cursor movement in an input array > >or a display array statement. I am sure somebody has found a > >solution to this scenario. Can someone point me in the right > >direction, please? > > >[...] > > How about doing the error checking in an 'AFTER ROW' clause ? > Then each row will be checked after entry, and the 'NEXT FIELD" > clause should go to the correct field in the current row. It would be nice if it did, but up to 4.10 at least it doesn't; a Next Field on After Row goes to that field on whichever line to which your last key press 'pointed' (thus if the key which triggered After Row was Down Arrow, you find yourself on the correct field, but on the next line down in the array, which is rather exasperating). Some suggestions relevant to the original question with respect to maintaing better control in arrays: * Always check for field-level errors on an After Field clause, not After Row. * Always have at least one Required field in the array, thus stopping the sloppy situation of the operator scrolling half way down the screen and leaving a bunch of blank lines. * Wrap back to the first field of a row by doing a Next Field firstfield on After Field lastfield unless the operator has pressed a specific Next Row key (ie. up/down arrow) - using fgl_keyval() to check. As for the central problem of putting the operator on a specific row - well, I've never found a solution to that, either, which is why I do all error checking on a field basis, so they can't get beyond the row before you find there's something wrong. Scroll is one of the more (perhaps the most) useless commands in 4GL, unfortunately, which seems to promise a solution and then turns out to be not very much use for anything at all when you really take a look at it. To answer the possible rejoinder of "But what if you want to test a condition which can't be resolved until the row has been completed?" I answer that I would only allow the operator to leave the row when in a specific field on the line - usually the last one - (if anything had been altered, otherwise it doesn't matter) and do the row level check After Field on that field. -- Another Fine Product from <jim@bilpin.co.uk> {JimG : Hatfield, England}