[Pugged] bad toad
Lathrop Preston
ciapug@ciapug.org
Wed, 19 Mar 2003 09:29:19 -0600
And you would not believe how long it took me to find that bugger...
Laith
The very tired programer
----- Original Message -----
From: "David Champion" <dave@visionary.com>
To: <pug@ciapug.org>
Sent: Tuesday, March 18, 2003 11:15 AM
Subject: [Pugged] bad toad
> It's been quiet on this list... so for your comic relief:
>
> Lathrop caught a little bug in something I wrote a while back...
>
> if ($firstday >= 5 and $NumOfDays = 31) {
> $rows = 6;
> }
>
> ...oops. At the time I wrote it (2001), February showed the correct # of
> days. However, in 2002 and 2003, the first comparison evaluates as true,
> so the second one assigns the value of 31... oops.
>
> I bet I'm not the only one that's been bitten by the "=" operator acting
> as an assignment in evaluations. It's especially fun when you're
> switching between several different languages, and most of them don't
> act like PHP.
>
> -dc
>
> _______________________________________________
> Ciapug mailing list
> Ciapug@ciapug.org
> http://cialug.org/mailman/listinfo/ciapug
>