Sunday, 20 February 2011

Loops

There are three types of loops:
1.) For...Next
2.) Loop...Until
3.) Do While

The Loops all preform similar things, but each one is more specialised at different things than the others.

For...Next
Used to run a piece of code a which is a fixed number. As its name suggest, it is used when a function needs to be carried out FOR each of several items, which is identical processing. The For...Next loop changes a variable every time it runs, so that the function can be specialised for each item.

Loop...Until loop
Target loop, keeps looping until target is reached

Do While
Runs a piece of code that reacts to change, is sensor and monitors change.

No comments:

Post a Comment