CONSTRUCT-INPUT Discrepancies
Posted in 1995
Topics: Stored Procedures & SPL, Connectivity: ESQL/C, 4GL & Embedded SQL, Triggers, Constraints & Referential Integrity, Jobs, Consulting & Announcements
I am experiencing a discrepancy in the behavior of the CONSTRUCT statement. In particular, I am using Informix 4GL 4.11 and Online 5.02 on a HP. According to the Informix-4GL Supplement 4.1 which describes the enhanced statements, an ON KEY clause in a CONSTRUCT or INPUT would, I quote: "If the user triggers an ON KEY clause while entering data in the field, 4GL does the following: 1. Suspends the input of the current field. 2. Preserves the input buffer that contains the characters the user has typed. 3. Executes the statements in the corresponding ON KEY clause. 4. Restores the input buffer for the current screen field. 5. Resumes input in the same field with the cursor at the end of the buffered list of characters." See page S-88 (for CONSTRUCT) and S-114 (for INPUT). For the INPUT statement, it works as expected. However, for the CONSTRUCT statement, it does not. THE SITUATION CONSTRUCT WhereClause ON datefield, [other fields] FROM datefield, [other fields] .... ON KEY (F3, INTERRUPT, ESCAPE) EXIT CONSTRUCT .... END CONSTRUCT Let's say a date field in the screen form uses a FORMAT="dd mmm yy" attribute. In the INPUT or CONSTRUCT statements, I use the ON KEY (F3, INTERRUPT, ESCAPE) clause to trap a user's wish to cancel out of the current statement. If a user enters an incorrect value for the date field such as "12345678" and one of these keys, I am experiencing a behaviour summarized in the table below: INPUT CONSTRUCT <Escape> Works Fails <F3> Works Fails <Ctrl-C> (Interrupt) Works Works It fails because the form is validating the entry with an "Error in field" error message instead of passing control back to the CONSTRUCT statement. 1. Has anyone experienced this and what might be your solutions? 2. Is the manual correct? The reason why I ask is page S-88 (CONSTRUCT) continues with: "You can change this default behavior by performing the following tasks in the ON KEY clause: o Resuming input in another field by using the NEXT FIELD statement. o Changing the input buffer value for the current field by assigning a new value to the corresponding variable and then displaying the value." The last statement in the quote is suspect. It is identical to page S-114 for the INPUT statement. Variables cannot be used in the CONSTRUCT statement! If it can, one would be able to, during a CONSTRUCT, pop up a lookup table, select a value, and bring the value into the CONSTRUCT statement to fill the variable and BINGO, a user-friendly way of help naive users do query. Seriously, any help would be greatly appreciated. Patrick Huang pkh@scammell.vic_npb.telecom.com.au
Related threads
- how to get session-id ?!
- php and informix 9.20
- [Q] How do I force usage of index
- select ... into temp .. hangs