Re: Is the 4gl 4.12/13/whatever compiler a bit smarter
Posted in 1994
* Peter Jeffery (peterj@sage.compnews.co.uk) wrote: * : * : <STUFF DELETED> ( <--- Should have done this my last posting :-) * : * : format * : first page header * : call postscript_header() * : page header * : call postscript_page_headers() * : ... * From David Tomlinson: * 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 This works good, but putting \\n's in the RETURNed lines causes the REPORT to lose track of line counting. I tried a small sample program and put in a RETURN statement: RETURN "This is a test.\\nAnd here also." The report should have been 66 lines ( default ) but the actual file contained 67 lines. Other than that, I think this is a good solution. Robert Minter |Data Systems Support| \\\\\\_/// Programmer, Software Development | Orange, CA | ( _ _ ) internet: rob@dssmktg.com | Tel: 714.771.0454 | (| ^ |) bangpath: uunet.uu.net!dssmktg!rob| Fax: 714.771.3028 | \\`-'/ #include <disclaimer.h> \\_/