Array row field by field validation problem
Posted in 1994
Topics: General Discussion
A colleague of mine has been unable to find a decent method of validating an array row in situations where field by field validation would impair user input (i.e. complex cross validation of various fields which may be entered out of order). The following (desirable!) code fragment does not work: input array ... after row perform validation if validation fails, issue err msg & next field XYZ if not, change database records end input The problem is that the 'next field' statement moves the cursor to the XYZ field ON THE ROW AFTER THE ONE WITH THE ERROR. The only time I can validate is after the user (attempts) to leave the row, but 'after row' seems to be too late. I can't find a way to back up a row. 'After insert' would only cover new rows and I need to worry about updating old rows too. How about 'before after row', Informix? I am working on a real kludge that uses an invisible noentry field (dummy) at the end of each array row. The input array is put in a while loop. When an error is detected, the row number is stored, and I leave and re-enter the input array. The before row section performs 'next field dummy' to force the cursor to the next row until it makes it back to the original row with the error. Boo - Hiss - Hiss! This causes terrible scrolling, especially on lower speed terminals, never mind how rotten it makes the code look! Does anyone have a (reasonably) clean way of performing this type of validation? backing up a row during an input array? Please reply -> gth@litle.com and I will summarize responses if there is sufficient interest. Thanks in advance, gth@litle.com Litle & Co. 54 Stiles Road, Salem, NH, 03079