home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #27 / NN_1992_27.iso / spool / comp / database / informix / 2440 < prev    next >
Encoding:
Text File  |  1992-11-16  |  2.0 KB  |  51 lines

  1. Path: sparky!uunet!mcsun!sunic!isgate!krafla!gaukur
  2. From: gaukur@rhi.hi.is (Kristjan Gaukur Kristjansson)
  3. Newsgroups: comp.databases.informix
  4. Subject: Re: reports in 'if then' clauses (was: defer interupt)
  5. Message-ID: <5613@krafla.rhi.hi.is>
  6. Date: 16 Nov 92 10:19:38 GMT
  7. References: <1e0gm2INNppc@emory.mathcs.emory.edu>
  8. Sender: usenet@rhi.hi.is
  9. Lines: 39
  10. Nntp-Posting-Host: dyngja
  11.  
  12. In <1e0gm2INNppc@emory.mathcs.emory.edu> jerry@jerry.mendota.ingr.com (Jerry Jugovich) writes:
  13.  
  14. >-> I still also would like to know why I can't put the output section in a 
  15. >-> IF THEN clause. If I could do that then those other duplicate reports 
  16. >-> could be nuked. So because of the report functionality of I4gl I must create 
  17. >-> and maintain at least two times the number of reports required. 
  18. >->
  19.  
  20. Here is a case clause with 'different' calls to a report. "when H" and "when S"
  21. send the same data ordered on different columns, but I got duplicate reports
  22. anyways since I'm also having the third choice of "when L", but the point
  23. being that 'if then' clauses (and 'case' clauses) can be used.
  24.  
  25. case
  26.   when svar = "L" start report n_llisti to nafn_lista
  27.   when svar matches "[HS]" start report n_hlisti to nafn_lista
  28. end case
  29. display "" at 1,1
  30. display "N· er Θg a≡ skrifa sveitarfΘlagalistann..." at 1,1 attribute(reverse)
  31. foreach b_sveitir into r_sveitir.*
  32.   case svar
  33.     when "L" output to report n_llisti(r_sveitir.*)
  34.     when "H" call islnafn(r_sveitir.hreppur) returning r_sveitir.nafn1
  35.              call islnafn(r_sveitir.sveitarfelag) returning r_sveitir.nafn2
  36.              output to report n_hlisti(r_sveitir.*)
  37.     when "S" call islnafn(r_sveitir.hreppur) returning r_sveitir.nafn2
  38.              call islnafn(r_sveitir.sveitarfelag) returning r_sveitir.nafn1
  39.              output to report n_hlisti(r_sveitir.*)
  40.   end case
  41.   let fjoldi = fjoldi + 1
  42. end foreach
  43. message "Fj÷ldi φ ·rtaki = ", fjoldi
  44. close b_sveitir free b_sveitir
  45. case
  46.   when svar = "L" finish report n_llisti
  47.   when svar matches "[HS]" finish report n_hlisti
  48. end case
  49.  
  50.                 Gaukur.
  51.