View unanswered posts | View active topics It is currently Thu Jul 31, 2014 11:45 am






Reply to topic  [ 2 posts ] 
Recycling a program and creating Jump points 
Author Message
Rookie

Joined: Sun Feb 06, 2011 11:22 pm
Posts: 3
Post Recycling a program and creating Jump points
Two questions,
Once a program has ran its course, is there a way to get the program to recycle and start again from the beginning?(program is to run in its entirity 3 complete times?)
Is there a way to jump back to a prevoius part of a program if a certain condition has been met? (reset a sequence if all the steps were not followed correctly)(Ball was dropped or part fell off)


Sun Feb 13, 2011 4:15 am
Profile
Moderator
Moderator
User avatar

Joined: Tue Sep 14, 2010 9:19 pm
Posts: 496
Post Re: Recycling a program and creating Jump points
To repeat a program 3 times, you would use a for loop:
Code:
for(int i = 0; i < 3; i++){
  //program
}


As for the jump point, you can use a goto statement, but in most cases that's considered unnecessary. You'll probably find it harder to debug your code if you use it. What are you trying to do exactly? Can you give details and post your code? The more information you give, the more help you'll get.

_________________
sudo rm -rf /


Sun Feb 13, 2011 4:43 am
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 2 posts ] 

Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  



Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by ST Software for PTF.