thanks guys, the following problem is solved now.
hi, i hope that someone can help me with this.
the array @xValues is a reference. how can i find out the length of the array? i have used
Code:
length(@xValues)
@xValues.length
already, but it only enters my loop once.
if i use
, then it doesn'e even enter the loop at all.
please help!
thank you.
Code:
else
{
print "elsif loop\n";
#@{$#xValues}
$number = $maxDataY - $minDataY;
$scale = ($height - 60) / $number;
$i = 0;
for ($j = 0; $j < @{$#xValues}; $j++) # here i need to know the length of the array
{
print "for loop\n";
$xCoordinate = $X + @$xValues[$i] - $minDataX;
$yCoordinate = int($Y + (@$yValues[$i] * $scale));
$i++;
$xCoordinate2 = $X +@$xValues[$i] - $minDataX;
$yCoordinate2 = int($Y + (@$yValues[$i] * $scale));
$$page->color( $red, $green, $blue,'RG');
print "color($red, $green, $blue, 'RG')\n";
$$page->line($xCoordinate, $yCoordinate, $xCoordinate2, $yCoordinate2);
print "line($xCoordinate, $yCoordinate, $xCoordinate2, $yCoordinate2)\n";
}# end for
}# end else
thanks guys, the following problem is solved now.