After Input in 4Gl
Posted in 1999
Topics: Connectivity: ESQL/C, 4GL & Embedded SQL
I use Informix-4GL and I don't know how to force to execute a After Field clause when Accept key is pressed, before After Input. Thanks.
You may want to move the desired clause to the ON KEY section example ... ON KEY ACCEPT ## put clause to execute here. jjcarrasco@geuropa.com wrote: > I use Informix-4GL and I don't know how to force to execute a After > Field clause when Accept key is pressed, before After Input. > > Thanks.
> >> I use Informix-4GL and I don't know how to force to execute a After >> Field clause when Accept key is pressed, before After Input. >> >> Thanks. > The current field's AFTER FIELD will be passed through when you hit ACCEPT. If there are other AFTER FIELD statements that you want to pass through then you are about to earn a stripe!!! You cannot easily direct the INPUT statement to pass through AFTER FIELD statements when the ACCEPT key is pressed (the current field, however, is passed through.) Most every 4GL programmer will have to deal with this situation. I have seen many just include the same code in both the AFTER FIELD and AFTER INPUT statements. If this is not to your liking, (it certainly wasn't to mine, since maintaining code in both places was a pain) then you can put the code in some function and call it from both places. One piece of advice: make sure any validation is in the AFTER INPUT as a MINIMUM. The validation after the AFTER FIELD statement is usually a friendly way to let the user know of invalid entry as it is being entered. I wish the INPUT statement worked differently. I have seen too many programs that had something in an AFTER FIELD and nothing in the AFTER INPUT. (The java model of throwing exceptions to the next higher level would have been helpful here) dk