>On Fri, 22 Jun 2001, Martijn van Exel wrote:
>
>>  Why the $! does
>>
>>  (int($cnt/2) == ($cnt/2))
>>
>>  not return TRUE for an even $cnt and FALSE for an odd $cnt ?
>
>Use the modulus operator %.  It returns a remainder of a division -- in
>the case of modulus 2, it will return either 0 or 1.
>
Thanks, this should work. Trying to implement:

foreach (@data)
{
if ($cnt % 2) {$bgeven = " BGCOLOR\=\"\#FFFFFF\""};
print("<tr".$bgeven.">"....cut irrelevant part.....);
$cnt++;
}

H'm..

This yields a table with the first row ($cnt=0) using standard 
BGCOLOR and *all* following rows displaying with BGCOLOR=#FFFFFF....

So my first throw at a check for 'even-ness' was probably all right, 
the problem is somewhere else.

Any suggestions?
-- 
Martijn van Exel, [EMAIL PROTECTED]

WEBkitchen
Waterstraat 11
3511 BW Utrecht
tel/fax 030-6701818

http://www.webkitchen.nl

Reply via email to