Re: Is the 4gl 4.12/13/whatever compiler a bit smarter
Posted in 1994
Topics: Connectivity: ESQL/C, 4GL & Embedded SQL
Peter Jeffery (peterj@sage.compnews.co.uk) wrote: : >Thinking a little bit: one reason why PRINT isn't allowed in arbitrary : >functions is because you can call arbitrary functions in either the page : >header or the page trailer block, and if the function could do printing, it : >would cause problems. Have you ever tried to conditionally print different : >amounts of code in the page header on odd and even pages of a report? You : >can't -- the headers are of a fixed size. Since I4GL isn't prepared to : >handle variable length page headers and trailers, it can't allow you to : >call a function which can do printing. At the moment, no function can do : >printing, so there is no problem. It might have to stop you calling : >functions in headers, or it would have to cope with variable length : >headers. Actually, headers aren't as bad as variable length page trailers! : This is a rather annoying feature. I have used reports to output pure : postscript to print and it takes some rather discusting coding to achieve. : It would be nicer if I could do : ... : format : first page header : call postscript_header() : page header : call postscript_page_headers() : ... : at least then it would be maintainable instead of having hundreds of lines : of random postscript sitting there. Informix may whup me for this posting, they probably won't support this code, but (with all standard disclaimers), try the following: FUNCTION func_1(l_var) DEFINE l_var INTEGER -- \\n will generate line feed CASE WHEN l_var = .... RETURN "line 1\\nline 2\\nline 3 ...." WHEN l_var = .... RETURN "..........................." ... END CASE END FUNCTION FUNCTION func_2(l_var) DEFINE l_var INTEGER -- \\n will generate line feed CASE WHEN l_var = .... RETURN "line 4\\nline 5\\nline 6 ...." WHEN l_var = .... RETURN "..........................." ... END CASE END FUNCTION ... REPORT xxx(r_var, ...) DEFINE r_var INTEGER OUTPUT ... FORMAT FIRST PAGE HEADER PRINT func_1(r_var) PAGE HEADER PRINT func_2(r_var) ON EVERY ROW ... ... END REPORT Used the following: INFORMIX-4GL Version 4.10.UC4 RSAM Version 4.10.UC3 I have a feeling your line counts are going to be pretty well hosed but that's the chance you take. DCT -- @ David Tomlinson @ @ dtomlnsn@netcom.com @ @ "By day fantastic birds flew through the petrified forest, and @ @ jeweled crocodiles glittered like heraldic salamanders on the @ @ banks of the crystalline river. By night the illuminated man @ @ raced among the trees, his arms like golden cartwheels, his @ @ head like a spectral crown...." @