I too have taken a closer examination of the eg/x/table.htm example file
that comes with the distribution and I am almost certain now that a bug in
this version (2.2.0) has been found. It seems that $cnt simply isn't
being set.
Here is the snippet of code relevant to the $cnt variable from the example
file:
###################################################################
<hr><h4>Using $cnt and $maxcol (three values per row)</h4>
[-$maxcol=3-]
<table>
<tr>
<td>[+ $i=$cnt +] </td>
<td>[+ $k[$cnt] +] </td>
<td>[+ $ENV{$k[$i]} +] </td>
</tr>
</table>
###################################################################
The actual output, as I am seeing it, is:
SCRIPT_NAME /table.htm
If $cnt were set as I believe it's supposed to be, the first cell of the
table output would be 0 (zero), not empty (NULL).
--Todd
On Wed, 26 Sep 2007, Gavin Spomer wrote:
> I think you have an excellent point, Todd.
>
> I first tried out your code. I produced the same output. So I went to the
> Embperl site to look up the $cnt variable since I've never used it before
> with dynamic tables, only the $row and $col ones. The definition states:
>
> "Contains the number of table cells displayed so far. (See HTML tag
> table.)"
>
> Seems to me, too, that by definition of $cnt your code should have had the
> intended 3 rows/columns. I didn't see any actual examples of $cnt on the
> website, but found one in the examples that came with the installation:
>
> [- @k = keys %ENV -]
>
> [-$maxcol=3-]
> <table>
> <tr>
> <td>[+ $i=$cnt +] </td>
> <td>[+ $k[$cnt] +] </td>
> <td>[+ $ENV{$k[$i]} +] </td>
> </tr>
> </table>
>
> Which only outputs:
>
> SCRIPT_NAME /pages/test.epl
>
> And looking at the source of the output:
>
> <table>
> <tr>
> <td> </td>
> <td>SCRIPT_NAME </td>
> <td>/pages/test.epl </td>
> </tr>
> </table>
>
> So I too am confused. Could someone further define $cnt and/or explain why it
> doesn't work as intended?
>
> Gavin Spomer
> Systems Programmer
> Brooks Library
> Central Washington University
>
> >>> Todd White <[EMAIL PROTECTED]> 09/26/07 6:05 AM >>>
> I'm wondering if anyone on this list would have any knowledge regarding
> the following Embperl question?
>
> Is anyone aware of a bug I may have encountered?
>
> Thanks.
>
>
> ---------- Forwarded message ----------
> Date: Wed, 26 Sep 2007 08:06:01 -0400 (EDT)
> From: Todd White <[EMAIL PROTECTED]>
> To: [email protected]
> Subject: RE: $cnt doesn't work for me as advertised
>
> Is anyone successfully using the $cnt and $maxcol variables?
>
>
>
> On Tue, 25 Sep 2007, Todd White wrote:
>
> > I'm expecting three rows of three columns, like so:
> >
> > A B C
> > D E F
> > G
> >
> > All I am getting is one row of one column.
> >
> > A
> >
> >
> > --Todd
> >
> >
> > On Tue, 25 Sep 2007, Tom Briles wrote:
> >
> > > Looks correct to me. What are you expecting?
> > >
> > > - Tom
> > >
> > > > -----Original Message-----
> > > > From: Todd White [mailto:[EMAIL PROTECTED]
> > > > Sent: Tuesday, September 25, 2007 3:50 PM
> > > > To: [email protected]
> > > > Subject: $cnt doesn't work for me as advertised
> > > >
> > > >
> > > > The variable $cnt doesn't seem to work for me. Am I doing something
> > > > wrong?
> > > >
> > > > Here's my code:
> > > > ##########################################################
> > > > <html>
> > > > <head>
> > > > <title>$cnt test</title>
> > > > </head>
> > > > <body>
> > > >
> > > > [- $maxcol = 3; -]
> > > > [+ $maxcol +]<p>
> > > >
> > > > [- @test_arr = ('A', 'B', 'C', 'D', 'E', 'F', 'G'); -]
> > > >
> > > > <table>
> > > > <tr>
> > > > <td>[+ $test_arr[$cnt] +]</td>
> > > > </tr>
> > > > </table>
> > > >
> > > > </body>
> > > > </html>
> > > > ###########################################################
> > > >
> > > > You can run this here:
> > > >
> > > > http://www.merit.edu/~tmwhite/test/cnt.epl
> > > >
> > > > ---------------------------------------------------------------------
> > > > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > > > For additional commands, e-mail: [EMAIL PROTECTED]
> > > >
> > > >
> > >
> > >
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > > For additional commands, e-mail: [EMAIL PROTECTED]
> > >
> > >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]