file includes - stopping multiple calls to same function
Posted: Wed Aug 13, 2003 5:09 pm
Hello, everyone.
I'm having trouble understanding some code to guard against accidentally calling on a function more than once when using included files.
"declare a variable in every include file you create:
$COMMON_INCLUDED=1;
and then test for it at the beginning of the include:
if (!$COMMON_INCLUDED) $COMMON_INCLUDED=1;
"
I don't understand this very well. Could someone please explain this to me? Does this mean that each file you include should have $COMMON_INCLUDED=1; in it? I don't understand what the 2nd line of code does or what it means.
Any help would be greatly appreciated.
I'm having trouble understanding some code to guard against accidentally calling on a function more than once when using included files.
"declare a variable in every include file you create:
$COMMON_INCLUDED=1;
and then test for it at the beginning of the include:
if (!$COMMON_INCLUDED) $COMMON_INCLUDED=1;
"
I don't understand this very well. Could someone please explain this to me? Does this mean that each file you include should have $COMMON_INCLUDED=1; in it? I don't understand what the 2nd line of code does or what it means.
Any help would be greatly appreciated.