Mailing List Archive

$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: embperl-unsubscribe@perl.apache.org
For additional commands, e-mail: embperl-help@perl.apache.org
RE: $cnt doesn't work for me as advertised [ In reply to ]
Looks correct to me. What are you expecting?

- Tom

> -----Original Message-----
> From: Todd White [mailto:tmwhite@merit.edu]
> Sent: Tuesday, September 25, 2007 3:50 PM
> To: embperl@perl.apache.org
> 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: embperl-unsubscribe@perl.apache.org
> For additional commands, e-mail: embperl-help@perl.apache.org
>
>



---------------------------------------------------------------------
To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
For additional commands, e-mail: embperl-help@perl.apache.org
RE: $cnt doesn't work for me as advertised [ In reply to ]
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:tmwhite@merit.edu]
> > Sent: Tuesday, September 25, 2007 3:50 PM
> > To: embperl@perl.apache.org
> > 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: embperl-unsubscribe@perl.apache.org
> > For additional commands, e-mail: embperl-help@perl.apache.org
> >
> >
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
> For additional commands, e-mail: embperl-help@perl.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
For additional commands, e-mail: embperl-help@perl.apache.org
RE: $cnt doesn't work for me as advertised [ In reply to ]
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:tmwhite@merit.edu]
> > > Sent: Tuesday, September 25, 2007 3:50 PM
> > > To: embperl@perl.apache.org
> > > 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: embperl-unsubscribe@perl.apache.org
> > > For additional commands, e-mail: embperl-help@perl.apache.org
> > >
> > >
> >
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
> > For additional commands, e-mail: embperl-help@perl.apache.org
> >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
> For additional commands, e-mail: embperl-help@perl.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
For additional commands, e-mail: embperl-help@perl.apache.org
Re: $cnt doesn't work for me as advertised [ In reply to ]
On Wed, 26 Sep 2007, Todd White wrote:

I think the $cnt does not work.

You need to use $row and $col. I think it assumes array of array (perldoc
perllol) for $col or $maxcol to work.

[-
@test_arr = (['A', 'B', 'C'], ['D', 'E', 'F'], ['G', 'H'] );
-]
<table>
<tr>
<td>[+ $test_arr[$row][$col] +]</td>
</tr>
</table>

ABC
DEF
GH

If you set $maxcol = 2, then it will be
AB
DE
GH

I guess even if $cnt is not broken, it will not work for 2 dimensional
arrays. Please correct me if I'm wrong.


Regards,

Ben K.
Developer
http://benix.tamu.edu

---------------------------------------------------------------------
To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
For additional commands, e-mail: embperl-help@perl.apache.org
Re: $cnt doesn't work for me as advertised [ In reply to ]
I shouldn't have to use $row and $col. And I shouldn't have to be working
with an array of an array.

--Todd


On Wed, 26 Sep 2007, Ben Kim wrote:

> On Wed, 26 Sep 2007, Todd White wrote:
>
> I think the $cnt does not work.
>
> You need to use $row and $col. I think it assumes array of array (perldoc
> perllol) for $col or $maxcol to work.
>
> [-
> @test_arr = (['A', 'B', 'C'], ['D', 'E', 'F'], ['G', 'H'] );
> -]
> <table>
> <tr>
> <td>[+ $test_arr[$row][$col] +]</td>
> </tr>
> </table>
>
> ABC
> DEF
> GH
>
> If you set $maxcol = 2, then it will be
> AB
> DE
> GH
>
> I guess even if $cnt is not broken, it will not work for 2 dimensional arrays.
> Please correct me if I'm wrong.
>
>
> Regards,
>
> Ben K.
> Developer
> http://benix.tamu.edu
>

---------------------------------------------------------------------
To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
For additional commands, e-mail: embperl-help@perl.apache.org
RE: Re: $cnt doesn't work for me as advertised [ In reply to ]
Hi,

$cnt is not (yet) implement in Embperl 2.x (it was in 1.x).
Documentation is a little bit out of date on this.

It should work to use

[+ $arr[$row*$maxcol+$col] +]

Gerald


------------------------------------------------------------------------
Besuchen Sie unseren Messestand auf der SYSTEMS vom 23. - 26.10. in
München, Halle B3, Stand 425 www.ecos.de/messen-events/systems-2007.html
------------------------------------------------------------------------
Gerald Richter ECOS electronic communication services GmbH
******************* SECURING YOUR NETWORK ********************

Post: Tulpenstrasse 5 D-55276 Dienheim b. Mainz
E-Mail: richter@ecos.de Voice: +49 6133 939-122
WWW: http://www.ecos.de Fax: +49 6133 939-333

Sitz der Gesellschaft: Dienheim; AG Mainz HRB 6889; GF: W.Heck,G.Richter
------------------------------------------------------------------------



> -----Original Message-----
> From: Todd White [mailto:tmwhite@merit.edu]
> Sent: Thursday, September 27, 2007 2:23 PM
> To: Ben Kim
> Cc: embperl@perl.apache.org
> Subject: Re: $cnt doesn't work for me as advertised
>
> I shouldn't have to use $row and $col. And I shouldn't have
> to be working with an array of an array.
>
> --Todd
>
>
> On Wed, 26 Sep 2007, Ben Kim wrote:
>
> > On Wed, 26 Sep 2007, Todd White wrote:
> >
> > I think the $cnt does not work.
> >
> > You need to use $row and $col. I think it assumes array of array
> > (perldoc
> > perllol) for $col or $maxcol to work.
> >
> > [-
> > @test_arr = (['A', 'B', 'C'], ['D', 'E', 'F'], ['G', 'H'] ); -]
> > <table> <tr>
> > <td>[+ $test_arr[$row][$col] +]</td> </tr> </table>
> >
> > ABC
> > DEF
> > GH
> >
> > If you set $maxcol = 2, then it will be AB DE GH
> >
> > I guess even if $cnt is not broken, it will not work for 2
> dimensional arrays.
> > Please correct me if I'm wrong.
> >
> >
> > Regards,
> >
> > Ben K.
> > Developer
> > http://benix.tamu.edu
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
> For additional commands, e-mail: embperl-help@perl.apache.org
>
>
> ** Virus checked by BB-5000 Mailfilter **
> !DSPAM:416,46fba258126381152355010!
>
>

** Virus checked by BB-5000 Mailfilter **

---------------------------------------------------------------------
To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
For additional commands, e-mail: embperl-help@perl.apache.org
RE: Re: $cnt doesn't work for me as advertised [ In reply to ]
Thank you, Gerald!

That work-around works perfectly!

Here is the link to prove it:

http://www.merit.edu/~tmwhite/test/cnt.epl

And here is the updated code that now works exactly as I need:

###############################################################
<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[$row*$maxcol+$col] +]</td>
</tr>
</table>

</body>
</html>
###############################################################


Thank you.
--Todd

On Sat, 29 Sep 2007, Gerald Richter - ECOS GmbH wrote:

> Hi,
>
> $cnt is not (yet) implement in Embperl 2.x (it was in 1.x).
> Documentation is a little bit out of date on this.
>
> It should work to use
>
> [+ $arr[$row*$maxcol+$col] +]
>
> Gerald
>
>
> ------------------------------------------------------------------------
> Besuchen Sie unseren Messestand auf der SYSTEMS vom 23. - 26.10. in
> München, Halle B3, Stand 425 www.ecos.de/messen-events/systems-2007.html
> ------------------------------------------------------------------------
> Gerald Richter ECOS electronic communication services GmbH
> ******************* SECURING YOUR NETWORK ********************
>
> Post: Tulpenstrasse 5 D-55276 Dienheim b. Mainz
> E-Mail: richter@ecos.de Voice: +49 6133 939-122
> WWW: http://www.ecos.de Fax: +49 6133 939-333
>
> Sitz der Gesellschaft: Dienheim; AG Mainz HRB 6889; GF: W.Heck,G.Richter
> ------------------------------------------------------------------------
>
>
>
> > -----Original Message-----
> > From: Todd White [mailto:tmwhite@merit.edu]
> > Sent: Thursday, September 27, 2007 2:23 PM
> > To: Ben Kim
> > Cc: embperl@perl.apache.org
> > Subject: Re: $cnt doesn't work for me as advertised
> >
> > I shouldn't have to use $row and $col. And I shouldn't have
> > to be working with an array of an array.
> >
> > --Todd
> >
> >
> > On Wed, 26 Sep 2007, Ben Kim wrote:
> >
> > > On Wed, 26 Sep 2007, Todd White wrote:
> > >
> > > I think the $cnt does not work.
> > >
> > > You need to use $row and $col. I think it assumes array of array
> > > (perldoc
> > > perllol) for $col or $maxcol to work.
> > >
> > > [-
> > > @test_arr = (['A', 'B', 'C'], ['D', 'E', 'F'], ['G', 'H'] ); -]
> > > <table> <tr>
> > > <td>[+ $test_arr[$row][$col] +]</td> </tr> </table>
> > >
> > > ABC
> > > DEF
> > > GH
> > >
> > > If you set $maxcol = 2, then it will be AB DE GH
> > >
> > > I guess even if $cnt is not broken, it will not work for 2
> > dimensional arrays.
> > > Please correct me if I'm wrong.
> > >
> > >
> > > Regards,
> > >
> > > Ben K.
> > > Developer
> > > http://benix.tamu.edu
> > >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
> > For additional commands, e-mail: embperl-help@perl.apache.org
> >
> >
> > ** Virus checked by BB-5000 Mailfilter **
> > !DSPAM:416,46fba258126381152355010!
> >
> >
>
> ** Virus checked by BB-5000 Mailfilter **
>