Re: What's being thrown away?



Nevermind. I replaced the for loop with a while loop and it eliminated the problem.

Mathew

Mathew Snyder wrote:
In the following snippet of code I'm getting the "useless use of a private
variable in a void context" error. It is at line 64 which is the closing brace
for the for loop.

for ($count; $count < 7; $count++) {
if ($day == '01') {
if (exists($months31{$month})){
$day = 31;
push @days, $day;
$day--;
}elsif (exists($months30{$month})){
$day = 30;
push @days, $day;
$day--;
}else{
$day = 28;
push @days, $day;
$day--;
}
}else{
push @days, $day;
$day--;
}
} # Line 64

All variables are declared elsewhere.

The only thing I can think is happening is that a return value is being expected
but isn't being provided. I can provide the entire script if needed for context.

Mathew

.



Relevant Pages

  • Re: defered word options
    ... Traditional Forth code might look like outside the loop: ... IF PUSH; THEN DROP; ... ' MYFUCTION IS THEFUNCTION ... memory architecture, as well as on application demands. ...
    (comp.lang.forth)
  • Re: Compilers, Aho/Sethi/Ullman, Exercise 2.15
    ... For example if j = 5 before the loop, ... push v onto the stack ... lvalue l... ... throw away value on top of stack ...
    (comp.compilers)
  • Re: Whats being thrown away?
    ... Mathew Snyder wrote: ... variable in a void context" error. ... It is at line 64 which is the closing brace ... But it doesn't look like you are using $count inside the loop anyway so why ...
    (perl.beginners)
  • Re: Whats being thrown away?
    ... On 12/31/2006 05:04 AM, Mathew Snyder wrote: ... variable in a void context" error. ... It is at line 64 which is the closing brace ... for the for loop. ...
    (perl.beginners)
  • Re: Repairmans knot
    ... I like the "push the loop through" at the end rather than "push the plug through". ... Lately, for certain cables that get wrapped and unwrapped frequently, I've taken to doubling the cord back on itself, as many times as is convenient, and tying a simple overhand knot in the entire loop. ...
    (sci.electronics.repair)