Re: Sometimes I just wonder, "WHY?!"
Posted in 1994
jsturm@garnet.msen.com (Jeffrey Sturm) writes: >Alan Popiel (alan@po.den.mmc.com) wrote: >: ... >Right, same as 4GL. Conditionals like the following are also illegal: > page header > if foo = bar then > skip 2 lines > else > skip 3 lines > end if >I once discovered that you can use a goto in a page header to jump out into >a different report block. This fools 4GL completely--the line counter was >thrown off and the printout was a mess. Nevertheless I used it to jump >from a "first page header" block to a "page header" block when I wanted >to do some initilization on the first call but print the same header. Then >I decided that it was really awful code and rewrote it anyway. Hey, maybe >you could use the same "trick" to dynamically alter the page length! That's >an even worse idea. Never mind :-) If you mean to print the same header, but need to initialize once, I suggest a cleaner way is: PAGE HEADER IF PAGENO = 1 THEN # initialize first time in LET ... END IF PRINT ... I avoid exiting REPORT control blocks early (via GOTO or RETURN); I've heard several stories of people getting into trouble by doing so. I avoid GOTOs on general principle, not just in REPORTs. ======================================================================= Dennis J. Pimple dennisp@informix.com Opinions expressed Senior Consultant -------------------- are mine, and do not Informix Software Inc Voice: 303-850-0210 necessarily reflect Denver Colorado USA Fax: 303-779-4025 those of my employer.