Re: using CONSTRUCT in 4gl
Posted in 1992
>From: uunet!nynnexst.com!matrix (Howard Greenblatt) >Message-Id: <1992May7.204349.12443@nynexst.com> >Subject: using CONSTRUCT in 4gl >Date: 7 May 92 20:43:49 GMT >X-Informix-List-Id: <news.1211> > >Hi. > >Does anybody know how to use existing data in program variables >in a CONSTRUCT statement? In other words, I want to duplicate the >effect of the "WITHOUT DEFAULTS" construct of the INPUT statement. > >I have data I am loading into program variables and then displaying >on a form. The user then wants to modify the existing data and >construct a query from the modified data. The problem is that when >I use CONSTRUCT, the existing data in my program variables gets >wiped out. > >Thanks for your help! >- Howard Q1: Are you using I4GL 4.10? If not, go get it before proceeding to Q2. Q2: Have you looked at the example code in the 4.10 Supplement, page S-84? If not, go and look at the supplement before proceeding to Q3. Q3: So, you are doing what it says? There must be some sort of misunderstanding about what is meant to be going on. The function get_fldbuf can be used in the AFTER CONSTRUCT to fetch the values typed by the user. The results should be assigned to a bunch of CHAR variables, not to variables of the type corresponding to the column on which the query will operate. This is so that things like a range of dates (1992-04-01:1992-04-30) can be stored. The char strings need to be long enough -- I'd suggest CHAR(80) until further notice. These strings should then be displayed in the BEFORE CONSTRUCT to re-instate the previous query. You should probably watch out for interrupts in the AFTER CONSTRUCT clause: AFTER CONSTRUCT IF INT_FLAG = FALSE THEN LET str_record.* = get_fldbuf(scr_record.*) END IF If you are still claiming that things are getting cleared, then I'd like to see the code please. Or rather, the smallest subset of the code that demonstrates the same symptoms. Yours, Jonathan Leffler (johnl@obelix.informix.com) #include <disclaimer.h>