Special

Introducing the “Welcome to Xojo” Bundle!

New to Xojo and looking for guidance? We've put together a terrific bundle to welcome you! Xojo Bundle

This bundle includes six back issues of the magazine -- all of year 21 in printed book and digital formats -- plus a one-year subscription (beginning with 22.1) so you'll be learning all about Xojo for the next year. It's the perfect way to get started programming with Xojo. And you save as much as $35 over the non-bundle price!

This offer is only available for a limited time as supplies are limited, so hurry today and order this special bundle before the offer goes away!

Article Preview


Buy Now

Issue 4.2

COLUMN

Getting Loopy

Using the right loop

Issue: 4.2 (November/December 2005)
Author: Marc Zeedar
Author Bio: Marc taught himself programming in high school when he bought his first computer but had no money for software. He's had fun learning ever since.
Article Description: No description available.
Article Length (in bytes): 15,294
Starting Page Number: 30
Article Number: 4213
Resource File(s):

Download Icon 4213.zip Updated: 2013-03-11 19:07:59

Related Link(s): None

Excerpt of article text...

Loops are one of the most important concepts in computer programming -- in a sense, that's all computers do. They loop, or repeat a series of actions, such as waiting for a user to tell it to do something. Loops are so basic, however, that they are rarely explained. Many beginners or self-taught programmers just absorb looping from looking at other code and just use one kind of loop and tend to forget that there are multiple kinds. Rarely do beginners take the time to figure out what kind of loop is best for the situation at hand. However, there are different loop types for a reason, and in today's lesson we're going to explore them.

For-Next Loop

The most common loop is the familiar for-next loop, which increments a counter each time through the loop. This is ideal for when you know how many times you need to go through the loop. For instance, for processing a number of files or counting through an array of data. I'm sure you're all familiar with this common loop so I won't spend a great deal of time on it, but there are some rarely used aspects of for-next that some beginners may not know about and more experienced programmers may have forgotten.

...End of Excerpt. Please purchase the magazine to read the full article.