Re: Best Way To Handle Multiple FORMS?
Posted in 1993
In-Reply-To: <1993Apr23.183904.3870@venice.sedd.trw.com> ries@hqrim.sedd.trw.com (Marc Ries) > What's the best way to handle multi-page forms (besides the 4GL > error message that it will only recognize the first screen 8-) ?) I had to write one of these today and it was not enjoyable. I ended up writing the following: define nextScreen smallint # -1 Cancel input # 0 Accept # x > 0 Next screen number let nextScreen = 1 while nextScreen > 0 call showScreen( nextScreen ) # Displays form let nextScreen = inputForm( nextScreen ) end while ... function inputForm ( nextScreen ) define nextScreen smallint case nextScreen when 1 let nextScreen = inputForm1() ... when x let nextScreen = inputFormx() end case return nextScreen end function function inputForm3() define prevField smallint, # Name of last edited field nextScreen smallint # Next screen to go to input by name ... before field firstField if prevField = "lastField" then let nextScreen = 4 exit input end if after field firstField let prevField = "firstField" after field secondField let prevField = "secondField" after field 2ndLastField let prevField = "2ndLastField" after field lastField let prevField = "lastField" before field lastField if prevField = "firstField" then let nextScreen = 2 exit input end if on key (accept) let nextScreen = 0 exit input end input if int_flag then let in_flag = false let nextScreen = -1 end if return nextScreen end function -- David W. Chan Tel/Fax: +44 71 488 0679 Objective Research Ltd. Email: dwc@cix.compulink.co.uk