Counter param value not passed from one sub to another

Counter param value not passed from one sub to another

am 19.10.2007 04:14:24 von ben.rogers

Howdy,

I count some items in someSub, and I can print to STDOUT ok. In other
words, $uniqueitem_counter has a value. I then call showCounters which
should display a string and the value of $uniqueitem_counter. However,
it only shows the string. I've stared at this for quite a while and
just can't grasp why $uniqueitem_counter isn't showing up in the UI
when I know it has a value.

thanks,

ben


###### Sub in which counting occurs.

sub someSub {
.......
bunch of code
$uniqueitem_counter++;
......
print STDOUT ("Found $uniqueitem_counter unique items."); # Prints
ok.
showCounters("Unique items found:", $uniqueitem_counter);
}


########### Panel to display count result.

my $belowTabsUISub4 = $belowTabsUISub2 -> Frame()-> pack();

sub showCounters($$) {

$belowTabsUISub4 -> Label(-text => $_[0])-> pack(); # Prints
$belowTabsUISub4 -> Label(-textvariable => $_[1],-fg => 'red')->
pack(); # Doesn't print.

}

Re: Counter param value not passed from one sub to another

am 19.10.2007 04:49:38 von ben.rogers

AAAArgh!

$belowTabsUISub4 -> Label(-textvariable => $_[1],-fg => 'red')->

Should have been:

$belowTabsUISub4 -> Label(-text => $_[1],-fg => 'red')->