Re: using CONSTRUCT in 4gl
Posted in 1992
In article <1992May7.204349.12443@nynexst.com> matrix@nynnexst.com (Howard Greenblatt) writes: > >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 Construct does not read the program variables, only the screen field values. In 4.1xxx you can DISPLAY p_file.var TO field_name using a BEFORE FIELD that does an EXIT CONSTRUCT once all fields have been "displayed" and the construct will execute. I've several cases of this in my current project where I build a construct if needed during an input statement. Its a completely transparent process to the user. CONSTRUCT was essentially brain-dead pre 4.1xxx as it did not allow BEFORE FIELD, AFTER FIELD, ON-KEY etc that an INPUT statement would, but a little creative hacking should let you display your program variables to the fields. Ie: CONSTRUCT WBUF ON field list CALL displaying_funct(). Actually getting the thing to exec may be tricky though without moving the cursor thru the fields, and not having a mechanisim to do so other than the RETURN key :-) THen again I never tried that pre 4.1xxx so maybe you'll get lucky and the display will trigger it off? Don "accesing from very spastic net access" Bolton