mechail

FOR…NEXT loop

In Uncategorized on April 16, 2008 at 1:49 pm

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.

  1. [...] updates Within a week of posting the workarounds for a couple of bugs in the structures as stated here and here, they were fixed (thats efficiency for ya)! New version with bug fixes will be releasing [...]