Re: Error No. - 4420
Posted in 1994
>From: adel@q8petroleum.com.kw (Adel Al-jouhar) >Subject: Error No. - 4420 >Date: Tue, 18 Oct 1994 14:24:07 GMT >X-Informix-List-Id: <news.9306> >Does any 1 know how 2 overcome error no. - 4420...? It depends on what you mean by overcome. The text from finderr and the error message manual is quite clear: -4420 The number of lines printed in the IF part of an IF-THEN-ELSE statement of a header or trailer clause must equal the number of lines printed in the ELSE part. 4GL needs to know how many lines will be filled in header and trailer sections (otherwise it could not know how many detail rows to put on the page). Since it cannot tell which part of an IF statement will be executed, it requires that both produce the same number of lines of output. Put another way, 4GL does not allow variable size page header or page trailer blocks. That means it does not allow PRINT FILE statements in page end blocks, as well as not allowing an unbalanced number of conditionally executed PRINT statements. The compiler is relatively good at counting -- it notices if the PRINT statements have semi-colons on the end to suppress new lines. If your question is "how do I avoid getting the error", the answer is you stop trying to do things like: IF some_value > some_other_value THEN PRINT "Some text" END IF in your PAGE HEADER block. If your question is "how do I get variable length PAGE HEADER blocks", the answer is "with excruciating difficulty, especially if you have compound BEFORE or AFTER GROUP OF blocks in the report". Basically, the variable portion of the PAGE HEADER block has to be simulated in the ordinary printing blocks. Pay attention to what it says in the I4GL 4.10 Supplement on pages S-49 and S-50; there have been a couple of bugs reported recently which were not bugs because the behaviour was documented there. And it is likely to affect your code. One of the bug numbers was B32014. Yours, Jonathan Leffler (johnl@informix.com) #include <disclaimer.h>