On Mon, 2002-04-01 at 17:24, Jonathan E. Paton wrote:
> > For debugging purposes I like to be able
> > to see entire functions (and sometimes
> > more than one) on the screen at the same
> > time. With short loops like this one that
> > means keeping it as short and sweet as
> > possible to maxim
That's why you need to stop programming on your Palm Pilot. :)
-Original Message-
From: Chas Owens [mailto:[EMAIL PROTECTED]]
Sent: Monday, April 01, 2002 1:33 PM
To: Nikola Janceski
Cc: [EMAIL PROTECTED]
Subject: Style issues (was RE: Increment a Variable)
No offense taken (TMT
> For debugging purposes I like to be able
> to see entire functions (and sometimes
> more than one) on the screen at the same
> time. With short loops like this one that
> means keeping it as short and sweet as
> possible to maximize the amount of code
> visible at one time.
Get a bigger monito
---
> > From: Chas Owens [mailto:[EMAIL PROTECTED]]
> > Sent: Monday, April 01, 2002 4:09 PM
> > To: Michael Stearman
> > Cc: [EMAIL PROTECTED]
> > Subject: Re: Increment a Variable
> >
> >
> > On Mon, 2002-04-01 at 16:03, Michael Stearman wrote:
&g
On Monday, April 1, 2002, at 01:03 , Michael Stearman wrote:
> $x="A";
> foreach $list(@list) {
> $cell="$x1";
> $worksheet1->write($cell, $list);
> $x++;
> }
it's a 'scoping' bug - try
$cell = "${x}1";
this will generate your
A1
THANKS I have been
; To: [EMAIL PROTECTED]
> Subject: Re: Increment a Variable
>
>
> > It could be my code.
>
> It is, trust me.
>
> > I am using the variable to write to an
> > Excel file in which I want to increment
> > the cell from A1 to B1 to C1, etc.
> >
ael Stearman
> Cc: [EMAIL PROTECTED]
> Subject: Re: Increment a Variable
>
>
> On Mon, 2002-04-01 at 16:03, Michael Stearman wrote:
> > It could be my code. I am using the variable to write to
> an Excel file in
> > which I want to increment the cell from A1 to B1
Micheal,
try this"
$x = "A";
foreach $list(@list) {
$cell = "$x{1}"; //you can't just put a suffix to a variable when
you print it..perl will think //you mean $x1.. use
$x{whateveryouwanttoadd} for example... $num = 4; print "$sun{th}"; //to
make it 4th
$worksheet->write($cell,
> It could be my code.
It is, trust me.
> I am using the variable to write to an
> Excel file in which I want to increment
> the cell from A1 to B1 to C1, etc.
>
Generalising your code:
> $x="A";
> for (0..3) {
> $cell="$x1";
> print $cell . "\n"
> $x++;
> }
And what do you
On Mon, 2002-04-01 at 16:03, Michael Stearman wrote:
> It could be my code. I am using the variable to write to an Excel file in
> which I want to increment the cell from A1 to B1 to C1, etc.
>
> $x="A";
> foreach $list(@list) {
> $cell="$x1";
> $worksheet1->write($cell, $list);
>
It could be my code. I am using the variable to write to an Excel file in
which I want to increment the cell from A1 to B1 to C1, etc.
$x="A";
foreach $list(@list) {
$cell="$x1";
$worksheet1->write($cell, $list);
$x++;
}
>From: "Michael Stearman" <[EMAIL PROTECTED]>
>T
works for me.
$a = "A";
$a++;
print "$a\n"; # prints B
what version are you using? ++ is magical on letters in ver 5.500?+ I think.
Just remember that -- is not magical on letters, you will always get -1 from
that.
> -Original Message-
> From: Michael Stearman [mailto:[EMAIL PROTECTED]
> I was wondering if anyone knew how to increment a variable when the variable
> is a letter. For example
>
> $x="A";
> $x++;
jep@delta:/ > perl
$x = 'A';
print ++$x . "\n";
B
jep@delta:/ >
Seems to work for me :) Remember the difference between preincrement and
postincrement, and what
happ
On Mon, 2002-04-01 at 15:50, Michael Stearman wrote:
> Hi,
>
> I was wondering if anyone knew how to increment a variable when the variable
> is a letter. For example
>
> $x="A";
> $x++;
>
> doesn't work. I'm trying to get $x="B";
>
> Thanks,
> Mike.
Works for me, perhaps you could post th
14 matches
Mail list logo