Re: Sometimes I just wonder, "WHY?!"
Posted in 1994
> > Peter Wiley - Poultry (peter@prospect.anprod.csiro.au) wrote: > : I always use the FIRST PAGE HEADER block to initialise all my report variables > : then follow it with the actual header control code. I duplicate the header > : control code (cut & paste) for the PAGE HEADER block. Never had any real > : problems with this (except occasionally forgetting to edit both sections :). > > : A bit of a pain but perfectly workable. > > : Peter Wiley > > Ever tried this? > > FIRST PAGE HEADER > ... do some initial stuff ... > goto real_page_header > skip 8 lines > > PAGE HEADER > label real_page_header: > ... print 8 lines of header stuff ... > > Pretty ugly, but it works! I've used it when it was just too painful to > cut and paste the whole header (about 50 source lines). You have to include > the "skip 8 lines", even though it never gets executed, and it has to match > the size of the actual page header or the internal report line counter gets > very confused. > > Sometimes 4GL suprises me for what it allows :-) > > Jeffrey Sturm > My colleague Todd responds, "Why not use the elegant?". We use the following in ACE reports all the time. It _should_ work in 4GL as well. How about _not_ using a first page header at all, and using this (which I find easier and simpler than the above): PAGE HEADER if (pageno = 1) then ... do all first page header stuff here, i.e. initialize variables, etc. If doing any first-page-specific printing here, there must be an "else" that prints the same number of lines. ... print 8 lines of header stuff ... Maybe 4GL doesn't have the "pageno" variable? Otherwise, this seems much more obvious and easier to maintain... -- *************************************************************************** Todd Sibert e-mail: t-sibert@bethel.edu Financial Aid/Admissions phone: (612) 638-6241 Bethel College St. Paul, MN *************************************************************************** -- Dan Madvig e-mail: d-madvig@bethel.edu Bethel College & Seminary phone: (612) 638-6414 3900 Bethel Drive fax: (612) 638-6001 St. Paul, MN 55112 In theory, there is no difference between theory and practice; But in practice, there is.