Re: reports in 'if then' clauses (was: defer interupt)
Posted in 1992
In <1e0gm2INNppc@emory.mathcs.emory.edu> jerry@jerry.mendota.ingr.com (Jerry Jugovich) writes: >-> I still also would like to know why I can't put the output section in a >-> IF THEN clause. If I could do that then those other duplicate reports >-> could be nuked. So because of the report functionality of I4gl I must create >-> and maintain at least two times the number of reports required. >-> Here is a case clause with 'different' calls to a report. "when H" and "when S" send the same data ordered on different columns, but I got duplicate reports anyways since I'm also having the third choice of "when L", but the point being that 'if then' clauses (and 'case' clauses) can be used. case when svar = "L" start report n_llisti to nafn_lista when svar matches "[HS]" start report n_hlisti to nafn_lista end case display "" at 1,1 display "Nz er ig ap skrifa sveitarfilagalistann..." at 1,1 attribute(reverse) foreach b_sveitir into r_sveitir.* case svar when "L" output to report n_llisti(r_sveitir.*) when "H" call islnafn(r_sveitir.hreppur) returning r_sveitir.nafn1 call islnafn(r_sveitir.sveitarfelag) returning r_sveitir.nafn2 output to report n_hlisti(r_sveitir.*) when "S" call islnafn(r_sveitir.hreppur) returning r_sveitir.nafn2 call islnafn(r_sveitir.sveitarfelag) returning r_sveitir.nafn1 output to report n_hlisti(r_sveitir.*) end case let fjoldi = fjoldi + 1 end foreach message "Fjvldi m zrtaki = ", fjoldi close b_sveitir free b_sveitir case when svar = "L" finish report n_llisti when svar matches "[HS]" finish report n_hlisti end case Gaukur.