Re: Problem Initializing CONSTRUCT-Fields
Posted in 1995
You haven't tried using NEXT FIELD instead of CONTINUE CONSTRUCT; this would do more or less what you want. The same technique should be used in INPUT statements too, when you need to set the value in an AFTER FIELD or ON KEY (or BEFORE FIELD) clause and want the value to 'take'. However, there is a bug B14553 which means that if you try to display a condition such as "1234|2345|3456" to a SMALLINT field (6 characters on the screen), the actual criterion is truncated to "1234|2", which is not very helpful. This bug has been fixed in 4.13/6.01. Yours, Jonathan Leffler (johnl@informix.com) #include <disclaimer.h> }From: rb@argon.in-ulm.de (Richard Bahcic) }Subject: Problem Initializing CONSTRUCT-Fields }Date: 3 Jan 1995 17:40:50 GMT }X-Informix-List-Id: <news.10551> } }Our Configuration and installation-order: } SCO 3.2.4 } Informix SQL 4.11.UC1 } Informix RDS 4.11.UC1 } Informix ID 4.11.UC1 } Informix Online 5.01.UD2 } }I have a Problem with a well-documented 4GL-Feature of the Construct- }Statement: }It is more than boring that everytime you enter a CONSTRUCT ... END CONSTRUCT }Clause, you have to type in your Search-Criteria again and again. } }Informix pronounced a solution for this problem in its book `4GL Supplement }Version 4.1' on page 84: }" ... You can use DISPLAY statements in the BEFORE CONSTRUCT clause to }populate the fields; DISPLAY initializes the field buffers to the displayed }values. ..." }A similar statement is given in the explanation of the BEFORE FIELD clause. } }We really tried everything, here the code: } }{CODE STARTS} } display form m_1 } let done = false } let accepted = false } # One of our last desperate tries was the initialization } # of the variable query } let query = "demo.demo_text = \\"Abri*\\"" } construct query on demo.* from sc_1.* }# construct by name query on demo.* } before construct } # 1st try } let pr1demo.demo_text = "Abri*" clipped } display by name pr1demo.demo_text }# display pr1demo.demo_text to sc_1.demo_text } sleep 1 } continue construct } before field demo_text } # 2nd try }# display by name pr1demo.demo_text } display pr1demo.demo_text to sc_1.demo_text } sleep 1 } continue construct } after field demo_text } error "After field clause passed" } on key (f2) } # 3rd try } let pr1demo.demo_text = "Abri*" clipped } display pr1demo.demo_text to sc_1.demo_text } sleep 1 } continue construct } on key (escape) } let done=true } exit construct } on key (interrupt) } error "Bitte die Auswahl mit <ESC> abbrechen" } continue construct } after construct } let accepted = true } end construct }{CODE ENDS} } }While the sleep - Statement is active, we see the value of the initialized }programrecord-member on the screen, but as soon as the construct continues, }the screen is empty again - and so ist the variable query! } }So, our question here is: }Did anyone of you try to realize an initialization of construct-fields and }did you succeed? } }Thanks in advance, } Richard