Re: Sometimes I just wonder, "WHY?!"
Posted in 1994
>From: nmalle@meddbs.med.miami.edu (Nimai Malle (Network Services)) >Subject: Sometimes I just wonder, "WHY?!" >Date: 26 Aug 1994 13:00:14 GMT >X-Informix-List-Id: <news.8390> >I've been developing a "simple" little thing using Informix ISQL only. >I came accross a problem today that has an easy work-around, but I just >wonder WHY I couldn't do it the way I wanted!! >... > >------------------------------------------------------------------------- > first page header > print file setsmall.prn ># ># The PRINT FILE command is not allowed within the FIRST PAGE ># HEADER, PAGE HEADER, or PAGE TRAILER clauses. ># See error number -8123. >------------------------------------------------------------------------- > >I wanted to keep my printer initialization in a separate file for ALL my >labels to use, with logical modular merit! >Now why do you suspect they bothered to slap on this restriction!?!? The reason for the restriction is that the PAGE HEADER and FIRST PAGE HEADER have to have a pre-computable size, so that the report knows exactly how many lines will be used by the page header on each page. One reason for this is so that the report system can ensure that there is space on the page for some data -- that the sum of your top and bottom margin and the length of the page header and page trailer leaves at least one line on the page for printing the body of the report. You can get more obscure errors by trying to do: -- ACE syntax first page header for i = 1 TO 10 do print # # Skipping lines inside of WHILE or FOR loops is not allowed # within PAGE HEADER or TRAILER. # See error number -8056. # if (i > 10) then print "i > 10" # # Within an IF-THEN-ELSE statement of a header or trailer # clause the number of lines printed in the IF part must equal # the number of lines printed in the ELSE part. # See error number -8112. # Yours sympathetically, Jonathan Leffler (johnl@informix.com) #include <disclaimer.h>