On December 14, 2003 03:09 pm, John W. Krahn wrote:
> Fred Nastos wrote:
> > On December 14, 2003 01:21 pm, km wrote:
> > How about the old-fashioned way?
> >
> > for ($i=1; $i<=10) {
> > print $i, "\n";
> > $i = $i + 3;
> > }
>
> That produces a syntax error, it won't run.
Really
Fred Nastos wrote:
>
> On December 14, 2003 01:21 pm, km wrote:
> >
> > but if i need to set a hop for each number how do i get it ? something like
> > stride functionality so that it will print 1,4,7,10 something like
> >
> > for(1..10 ,jump 3)
> > {
> > print;
> > }
>
> How about the old-fashi
On December 14, 2003 01:21 pm, km wrote:
>
> but if i need to set a hop for each number how do i get it ? something like
> stride functionality so that it will print 1,4,7,10 something like
>
> for(1..10 ,jump 3)
> {
> print;
> }
How about the old-fashioned way?
for ($i=1; $i<=10) {
prin
Km wrote:
>
> Hi all,
Hello,
> when i use range operator in foreach loop it increases the
> elements in the list by one.
> for eg :
> foreach(1..10)
> {
> print;
> }
> #prints 1,2,3,4,5,6,7,8,9,10
>
> but if i need to set a hop for each number how do i get it ?
> something like stride functio
Hi all,
when i use range operator in foreach loop it increases the elements in the list by
one.
for eg :
foreach(1..10)
{
print;
}
#prints 1,2,3,4,5,6,7,8,9,10
but if i need to set a hop for each number how do i get it ? something like stride
functionality so that it will print 1,4,7,10
so