Connecting Tech Pros Worldwide Forums | Help | Site Map

problem with for loop

Newbie
 
Join Date: Oct 2008
Posts: 5
#1: Nov 5 '08
Hi everybody


In my codes i am using two for loop (nested one) . i am taking values through param in that file but the loop is not creating problem for ten cyle but from 11 its giving problem its spliting 11 as double 1 and giving the result for file 1 ... how to clear this ...


thank you in advance....

nithinpes's Avatar
Expert
 
Join Date: Dec 2007
Posts: 400
#2: Nov 5 '08

re: problem with for loop


Post your code so that someone can see what's wrong in it.
Newbie
 
Join Date: Oct 2008
Posts: 5
#3: Nov 5 '08

re: problem with for loop


Quote:

Originally Posted by nithinpes

Post your code so that someone can see what's wrong in it.

Expand|Select|Wrap|Line Numbers
  1. for($i=1;$i<=$no;$i++)
  2. {
  3.   for($j=0;$j<=15;$j++)
  4.     {
  5.        my @lprobes;
  6.        my %sl;
  7.  
  8.        my $geneid = $gene[$i][$j];
  9.        if($geneid eq "") { next };
  10.        and Display things 
  11.      }
  12. }
  13.  
same like only the param loop also but there is no problem in param loop....
numberwhun's Avatar
Site Moderator
 
Join Date: May 2007
Location: New Hampshire
Posts: 2,572
#4: Nov 5 '08

re: problem with for loop


aarusiva,

You now have a couple of threads under your belt and both times we have been kind enough to fix your code tags. Code tags are needed to surround any code that you place into any post into the forums. Please use them from now on. If you do not know how to use them, simply reference the "REPLY GUIDELINES" box next to the Message box when replying.

This is your friendly warning.

Regards,

Jeff
Perl Forum Leader
KevinADC's Avatar
Expert
 
Join Date: Jan 2007
Location: Southern California USA
Posts: 4,091
#5: Nov 5 '08

re: problem with for loop


I can't understand what you said in your first post, I assume because English is not your first language, but in the code you posted I see this:

Expand|Select|Wrap|Line Numbers
  1. for($i=1;$i<=$no;$i++)
$i starts with 1 instead of 0 (zero) which might be part of your problem if not the whole problem.
Reply