FOR…NEXT loop

The FOR.. NEXT loop has got to be my favourite control structure of all time. Just something to take note of though;

The control variable MUST be a local or publicly declared variable. The use of a variable that is called by reference is not allowed.

What i mean by control variable is this:

Example:

Dim i As Integer i is the control variable

For i = 0 To 100

‘Statements Here

Next

Tip of the Day:
As everybody (well, almost everybody.. okay fine, programmers) knows, the use of the select case statement is similar to that of using an If..Elseif…Else..End If statement, however, if you’re into boosting the performance rate of the FI and optimizing your code for the best results, a good practice would be to use the If..Elseif..Else..End If statement instead of the Select Case statement for faster results. But in certain cases it really is easier to use the Select Case statement. But that depends on the individual programmer’s preference.

Advertisement
  1. April 21st, 2008
    Trackback from : Updates! « SOF.HACK

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.