Re: Local variable acting static in 4GL report
Posted in 1997
Jake, All variables in a REPORT are declared in the generated C code as 'static', precisely so that the values persist between OUTPUT TO REPORT statements. This means, for example, that the values of the variables will be the same for the AFTER GROUP OF block when the new values indicate that the group has changed. Hence, REPORT variables are different from other local variables. Yours, Jonathan Leffler (johnl@informix.com) #include <disclaimer.h> }From: Jacob Salomon <jake@apparel.net> }Date: Mon, 3 Feb 1997 13:15:49 GMT }X-Informix-List-Id: <news.33375> } }something strange is interfering with my debugging session. }I'm using all incarnations 4gl release 6.01.UD2 on HP-UX 10.01 } }I have a breakpoint at the entry to a report function, with the command }to print a local (to the report function) record variable named "tv". }The first time, all its members (smallints) are 0, of course. During }the course of the report, the various smallints are bumped up. However, }I expect it to *always* be 0 when I call the report function again. The }variable should be getting allocated on the stack and reinitialized }every time the function is entered. } }However, I am finding that upon entry to the report function the values }are set to whatever they were during the last "after group of" statement }block. } }This violates my understanding of local variables. I wonder if it is }causing a subtle program bug.