on1 construct

Jerry Aguirre jerry at oliveb.UUCP
Thu Nov 8 06:03:38 AEST 1984


How about:

#define on1(X) static char first_time_in = TRUE; if ((first_time_in) && (!(first_time_in = FALSE)))

function ()
{
    on1() {
	bla;
	bla;
	...
    };
    etc...
}

The evaluation of the && will reset the flag the first time thru.
Because the reseting is done as part of the test the braced part of
the code is not affected.

				Jerry Aguirre @ Olivetti ATC
{hplabs|fortune|idi|ihnp4|ios|tolerant|allegra|tymix}!oliveb!jerry



More information about the Comp.lang.c mailing list