Re: Sequencing of Page header and Before group
Posted in 1997
Been thru that, when setting up my little gimmick to put blobs in report (see faq, appendix M, and be aware that as of 4.13, it won't work unless you hack with the c code generated by i4glc4), and to me it's a bug - As stated in the 4gl supplement that should be the behaviour of the FIRST PAGE HEADER, not that of PAGE HEADER #1. I think you can simplify considerably the logic of your report doubling your PAGE HEADER into a FIRST PAGE HEADER and PAGE HEADER like thus FIRST PAGE HEADER LET variable=1 blah PAGE HEADER LET variable=variable+1 IF (variable=1) THEN blah ELSE yada END IF BEFORE GROUP OF whatever LET variable=0 SKIP TO TOP OF PAGE Still have to understand if the problem is gone w 4.17/6.05. To tell the truth, I'm still trying to understand if 4.17/6.05 were actually ported to SCO... Ciao, Marco _______________________________________________________________________________ Marco Greco, Catania, Italy marcog@linux.ctonline.it rem radioterapia +39 95 447828 fax 446558 Informix faq http://www.iiug.org/techinfo/faq/informix.htm 4glworks http://www.ctonline.it/~marcog Informix on Linux http://www.ctonline.it/~marcog/ifmxlinux.htm Bryan Tonnet wrote: } } I'm getting into an awful bind with the processing order of PAGE HEADER and } BEFORE GROUP OF in a 4GL report. } } Basically, my BEFORE GROUP OF clause sets some variables that are then } used conditionally in the PAGE HEADER block. eg. } } PAGE HEADER } } LET variable = variable + 1 } } IF variable = 1 THEN } blah } ELSE } yada } END IF } } BEFORE GROUP OF a } } LET variable = 0 } SKIP TO TOP OF PAGE } } Problem is that (my understanding only) the PAGE HEADER processing is } deferred until the "SKIP" in the BEFORE GROUP OF *except* on the first } page where the PAGE HEADER is processed before the BEFORE GROUP OF. The } report certainly acts this way, in any case. } } So, in order to set the variable on the *first* page, I have to } reproduce the BEFORE GROUP OF block in the PAGE HEADER like this; } } PAGE HEADER } } IF pageno = 1 THEN } LET variable = 0 } END IF } } LET variable = variable + 1 } } IF variable = 1 THEN } blah } ELSE } yada } END IF } } BEFORE GROUP OF a } } LET variable = 0 } SKIP TO TOP OF PAGE } } However, the variables I am setting are tracking the logical page numbers } within a GROUP, and the BEFORE GROUP *does* get executed on the first page } which mucks up the assignments. To get around this I need a conditional } in the BEFORE GROUP OF like so; } } PAGE HEADER } } IF pageno = 1 THEN } LET variable = 0 } END IF } } LET variable = variable + 1 } } IF variable = 1 THEN } blah } ELSE } yada } END IF } } BEFORE GROUP OF a } } IF pageno = 1 THEN } LET variable = 1 } ELSE } LET variable = 0 } END IF } SKIP TO TOP OF PAGE } } Getting ugly, eh? But there's more. Because the pageno doesn't change until } the "SKIP", the second page of the report (if it is a new group) still has } pageno = 1 and so gets variable = 2 after the PAGE HEADER executes. And I } can't put the "SKIP" at the top of the BEFORE GROUP because then the PAGE HEADER } executes immediately before the variables are set. } } I can write spagetti to circumvent all this, but I'm sure there's something } I'm missing that could turn it into a nice grilled trout with buttered } potatoes (maybe some sour cream). } } Sorry if I'm not explaining myself well, it's late and my eyes are getting } screen burn. } } Sorry if it's plainly obvious what to do, it's late and my eyes are } getting screen burn. } } I tried mucking about with AFTER GROUP which only made things more } convoluted. } } Thanks in advance } } [Anyone from Sarf Efrica - Shane Warne's warming up against the Kiwis, } rumour has it that Mr Cronje's boys are already starting to fake injuries } to try and get out of the Tests :) ] } } -- } Bryan Tonnet } batonnet@phase4.com.au