Re: FW: next field problem
Posted in 1995
} From: "Huddleston, Joe" <huddles@corp1.retail.com> } To: "Listserv: Informix" <informix-list@rmy.emory.edu> } Subject: FW: next field problem } Date: Wed, 15 Mar 95 08:41:00 PST } } i'm experiencing a problem with a NEXT FIELD statement, and i could use some } input. } } here's the code: } AFTER FIELD back_order } IF ((gr_dtl[gv_row].back_order <> "Y") } AND (gr_dtl[gv_row].back_order <> "N")) THEN } CALL prg_error(0, "VALUE ENTERED MUST BE EITHER \\"Y\\" OR \\"N\\"") } NEXT FIELD back_order } END IF } } here's the problem: } i'm in an input statement getting values for one row of an array. if an } invalid value is entered for the back_order field, i get a -1119 error (NEXT } FIELD name not found in form). obviously, the field name is there, or it } wouldn't even reach that part of the code. just to make sure, though, i } checked the .per and the spelling (about 50 times...). any ideas? i'm } using version 4.1 of informix and standard engine. } } thanks, } } -joe- } (huddles@hasting.com) One very good way to side-step the problem: Validate the back_order field by using an INCLUDE clause in your form instead of an AFTER FIELD clause in your program. INCLUDE works very well for simple value sets like Y/N Advantages: - Data validation for the field can be encapsulated in the form. - Your 4GL code will be simpler. - You can change your valid values [add "M" for maybe :-) ] by recompiling the form rather than the 4GL program. Disadvantages: - You get the standard message for form field value errors, rather than your own choice of wording. I've forgotten the exact wording of the standard error, but it is okay if somewhat generic. In terms of consistency, using the standard error message might be considered an advantage. Regards, Alan +---------------------------+-----------------------------------------------+ | R. Alan Popiel | Internet: alan@den.mmc.com | | Martin Marietta, SLS | Voice: 303-977-9998 | | P.O. Box 179, M/S 3810 | Standard disclaimers apply. Cutesy ones, too. | | Denver, CO 80201-0179 USA | Your mileage may vary. Void where prohibited. | +---------------------------+-----------------------------------------------+