24 Oct 2008 at 20:49 #1 OpenToSuggestions OpenToSuggestions Soldato Joined 5 Aug 2006 Posts 11,464 Location Derbyshire please delete . thanks Last edited: 24 Oct 2008
24 Oct 2008 at 20:52 #2 geuben geuben Associate Joined 23 Mar 2006 Posts 1,739 int i = 1; while (i = 1) if(x>0) blah blah else if(x<0) blah blah end end something like that should work.
int i = 1; while (i = 1) if(x>0) blah blah else if(x<0) blah blah end end something like that should work.
24 Oct 2008 at 20:54 #3 dave-lew99 dave-lew99 Associate Joined 14 Apr 2008 Posts 1,230 Location Manchester You could encompass it into a while loop and just do Code: while(1) { if(x < 0 || x > 0) { // do work // call break; when finished to get out of the while loop } }
You could encompass it into a while loop and just do Code: while(1) { if(x < 0 || x > 0) { // do work // call break; when finished to get out of the while loop } }
24 Oct 2008 at 21:30 #4 OpenToSuggestions OpenToSuggestions Soldato OP Joined 5 Aug 2006 Posts 11,464 Location Derbyshire Got it working, I thought I had it ok so deleted OP but turns out I was still wrong TY guys
24 Oct 2008 at 21:51 #5 OpenToSuggestions OpenToSuggestions Soldato OP Joined 5 Aug 2006 Posts 11,464 Location Derbyshire geuben said: int i = 1; while (i = 1) if(x>0) blah blah else if(x<0) blah blah end end Click to expand... Haven't tried a while loop yet! What geuben said works. Last thing is for the user to be able to chose to stop before the counter maxes out. How would I do that?
geuben said: int i = 1; while (i = 1) if(x>0) blah blah else if(x<0) blah blah end end Click to expand... Haven't tried a while loop yet! What geuben said works. Last thing is for the user to be able to chose to stop before the counter maxes out. How would I do that?