|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
|
|
Thread Tools | Rate Thread | Display Modes |
|
|
|
#1
|
|||||
|
|||||
|
Re: help with large loop
If the compiler accepts LargeNumber as a variable but not as a loop counter, then you could consider using an infinite loop with LargeNumber as a variable that you increment on each pass. Exit the loop when LargeNumber is greater than or equal to the # of passes that you want.
|
|
#2
|
||||
|
||||
|
Re: help with large loop
A for loop is a higher level construct of a more primitive algorithm.
You can just implement the base algorithm instead. The base algorithm has an initializer, a test & branch, the inner block, the incrementer and branch. One assignment, one test, one arithmetic operator. Enjoy |
|
#3
|
|||
|
|||
|
Re: help with large loop
With a for loop that large, it sounds like you're trying to create some sort of time delay. Assuming you're writing code for the robot controller, remember that your code is already running in a loop. To create a time delay write code like this:
int counter . . . while(true)//main loop { counter++; if counter<largeNumber { do nothing } else { do stuff } } If this is for a side project, disregard this comment entirely. |
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| pic: Holomonic (Bottom View) with Large Omni-Directional Wheel Kit | nonother | Extra Discussion | 9 | 16-05-2007 00:26 |
| Help! Making Continuous Loop out of Plastic Sheet | evolution | Technical Discussion | 7 | 19-02-2006 13:47 |
| problem with using a loop | CompMaster | Programming | 7 | 03-02-2006 16:44 |
| hey need some help with writing a code please help me here | magical hands | Programming | 9 | 01-01-2004 21:46 |
| NEED HELP with Delay loop for compressor relay switch | archiver | 2001 | 10 | 24-06-2002 02:11 |