Posted by David Gillen on 11/02/06 14:27
An noise sounding like Sonnich said:
> this is probably an old topic:
>
> if(a==1)
> if(b==2)
> echo "a is 1 and b is 2";
> else
> // what happens here?
> echo "a is 1 and b is not 2";
>
Simplify your code by writing more, but it will help you.
if(a==1 && b==2)
{
}
elseif(a==1 && b!=2)
{
}
else....
etc.
Nesting if's just leads to confusion in the long run. Esp 2 months later when
you're looking back at something. Do it the way suggested above and you'll
help to avoid confusion, and will benefit from readability in your code too.
D.
--
/(bb|[^b]{2})/
Trees with square roots don't have very natural logs.
What's the difference between ignorance and apathy? Who knows? Who cares?
Navigation:
[Reply to this message]
|