LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 08-12-2003, 03:06 AM   #1
jenny_psion
LQ Newbie
 
Registered: Aug 2003
Distribution: Fedora Core 3
Posts: 12

Rep: Reputation: 0
Unhappy references


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
Code:
@{$#xValues}
, 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.

Last edited by jenny_psion; 08-12-2003 at 06:19 AM.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
shell references nariman Linux - Newbie 3 02-25-2006 05:36 AM
Security references unSpawn Linux - Security 6 02-25-2006 01:04 AM
??Good C References Please?? InvisibleSniper Programming 9 10-28-2005 01:45 PM
re: FAQ: Security references german Linux - Security 1 07-14-2003 04:54 AM
references to other other sites pbharris LQ Suggestions & Feedback 10 04-10-2002 10:20 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 01:26 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration