Re: 4GL form won't fit on a screen
Posted in 1991
Path: emory!ogicse!sequent!muncher.sequent.com!lugnut From: lugnut@sequent.com Newsgroups: comp.databases.informix Message-ID: <1991Oct8.210339.12932@sequent.com> Date: 8 Oct 91 21:03:39 GMT References: <187026@unix.cis.pitt.edu> <1991Oct7.183403.25588@sequent.com> <187418@unix.cis.pitt.edu> Sender: news@sequent.com (News on Muncher) Organization: Sequent Computer Systems, Inc. Posted: Tue Oct 8 14:03:39 1991 In article <187418@unix.cis.pitt.edu> smfst2@unix.cis.pitt.edu (Seth M Fuller) writes: >>like, a function key may be un-needed, eflastkey testing after field can >>be used for opening a window. By nesting inputs (and screen calls) in >>an input function using a while loop with a case to control which segment >>goes where. (I have a single screen for example that uses 5 different >>input statements that are completely transparent to the user with a >>mechanisim that allows the user to move forward or backwards thru them >>without using a control key to do so. >> >>Don "what structure?" Bolton > >Could you post some code showing this technique? I'd like to see how >you do it. Sure, the following is 3 pieces, an internal msg I sent out to our Informix developers, the input control function, and one if the actual input stmts from a call tracking system I've been prototyping.. Undoccumented "feature" NOW you can read the direction of approach and conditionaly branch BEFORE and AFTER FIELD, ROW stmts.... I4GL ONLY!!!!!!!!! UP arrow = 2000 DOWN arrow = 2001 (also linefeed) LEFT arrow = 2002 RIGHT arrow = 2003 RETURN = 13 INTERUPT = 2011 TAB = 9 DEFINE elastkey SMALLINT <in GLOBALS It is automaticly "filled" by the 4gl execs. AFTER FIELD blarvitz IF "field condition" AND eflastkey = "X" THEN action END IF FUNCTION f_input(input_mode) DEFINE input_mode SMALLINT IF input_mode = R_ADD THEN CALL add_prep() CALL get_reqno() END IF LET wind_flag = FALSE LET new_addr = FALSE LET next_section = 1 WHILE next_section < 6 CASE next_section WHEN 1 IF input_mode = R_ADD THEN CALL add_req1() ELSE CALL mod_req1() END IF WHEN 2 IF input_mode = R_ADD THEN CALL add_phone() ELSE CALL mod_phone() END IF WHEN 3 IF input_mode = R_ADD THEN CALL add_req2() ELSE CALL mod_req2() END IF WHEN 4 IF input_mode = R_ADD THEN CALL add_focus() ELSE CALL mod_focus() END IF WHEN 5 IF input_mode = R_ADD THEN CALL add_task() ELSE CALL mod_task() END IF END CASE IF next_section = 6 AND NOT INT_FLAG THEN IF p_req_main.req_open = "N" THEN IF ck_open() THEN ERROR "Unable to close request with open task" SLEEP 2 LET next_section = 5 END IF END IF END IF IF next_section = 6 AND NOT INT_FLAG THEN PROMPT "Do you wish to commit this project record? Y or N " FOR answ IF answ MATCHES "[Yy]" THEN IF input_mode = R_ADD THEN CALL put_in() ELSE CALL update_it() END IF ELSE LET next_section = 1 END IF END IF IF INT_FLAG THEN IF input_mode = R_ADD THEN ERROR "Add ABORTED" CALL unadd_comm() CLEAR FORM ELSE ERROR "Update ABORTED" IF TMPFIL IS NOT NULL THEN CALL del_tmp(p_req_main.reqno) END IF CALL fill_scrn() END IF LET INT_FLAG = FALSE EXIT WHILE END IF END WHILE END FUNCTION input function #5 of 5 from main screen, generates unique key for each row so an associated text window can be opened for each row. FUNCTION add_task() DEFINE pa_curr SMALLINT DEFINE cur_lin SMALLINT DEFINE group_valu CHAR(10) CALL get_start() # Message displays tied to the input schema CALL disp_mess(next_section) INPUT ARRAY p_req_tasks WITHOUT DEFAULTS FROM sc_task.* BEFORE ROW LET pa_curr = arr_curr() LET scrn_ln = scr_line() BEFORE DELETE IF p_req_tasks[pa_curr].t_owner IS NOT NULL THEN LET var_taskno = p_req_tasks[pa_curr].t_taskno CALL delstcom(var_taskno) MESSAGE "Press CONTROL-W to open comments window, CONTROL-E to delete a task" ELSE ERROR "Nothing to remove" END IF AFTER DELETE IF answ MATCHES "[Yy]" THEN ERROR "Row has been Removed" END IF BEFORE FIELD t_owner # Task numbering IF p_req_tasks[pa_curr].t_taskno IS NULL THEN LET max_task = max_task + 1 LET p_req_tasks[pa_curr].t_taskno = max_task DISPLAY p_req_tasks[pa_curr].t_taskno TO sc_task[scrn_ln].t_taskno END IF BEFORE FIELD t_group # Group field autofill IF p_req_tasks[pa_curr].t_group IS NULL THEN LET p_req_tasks[pa_curr].t_group = gp_assigned DISPLAY p_req_tasks[pa_curr].t_group TO sc_task[scrn_ln].t_group END IF ON KEY (CONTROL-T) # Simulated blobs using flat text files IF p_req_main.reqno IS NOT NULL THEN CALL blob_menu() END IF ON KEY (CONTROL-B) # Move backwards to prior input stmt IF pa_curr >= 1 THEN LET next_section = next_section - 2 EXIT INPUT END IF ON KEY (CONTROL-W) # Open comments window IF p_req_tasks[pa_curr].t_owner IS NOT NULL THEN LET var_owner = p_req_tasks[pa_curr].t_owner LET var_taskno = p_req_tasks[pa_curr].t_taskno LET var_desc = p_req_main.req_type CALL com_wind() ELSE ERROR "A comment window cannot be opened without a task name" END IF ON KEY (CONTROL-V) # Open validation window IF INFIELD(t_group) THEN LET group_valu = p_req_tasks[pa_curr].t_group CALL show_groups(group_valu) RETURNING p_req_tasks[pa_curr].t_group DISPLAY p_req_tasks[pa_curr].t_group TO sc_task[scrn_ln].t_group END IF AFTER FIELD t_owner # If leaving null row heading to new row, exit input IF p_req_tasks[pa_curr].t_owner IS NULL AND eflastkey != 2000 THEN EXIT INPUT END IF AFTER FIELD t_group # Check field validaton IF p_req_tasks[pa_curr].t_group IS NOT NULL THEN IF no_t_group() THEN NEXT FIELD t_group END IF END IF IF p_req_tasks[pa_curr].t_group IS NULL THEN ERROR "Group field cannot be left blank" NEXT FIELD t_group