At the end of this Presentation, you
should be able to:

1. Define a For…Next Loop Structure
2. Understand the guidelines for a
   For…Next Loop Structure
3. Construct the syntax of For…Next
   Loop Structure
For…Next Loop Structure
• The For … Next is used when you
  know how many times the statements
  of the loop will be executed. It used
  a variable that serves as a counter
  that increases or decreases in value
  every time there is a loop.
For…Next Loop Structure Guidelines
• In the For … Next Loop execution:
               » The counter is set to the value of start.
               » Counter is checked if it is greater than the
                 end. If yes, it passes to the statements after
                 the Next, if not, the statements are
                 executed.
               » The counter is incremented by the amount
                 specified, if not specified, the counter is
                 incremented by 1.
               » Counter is incremented and goes back to step
                 b.
For…Next Loop Structure Syntax

For counter = start To end
   Statements
Next
Do…Until Loop Structure Example
A program that print number 10 to 20.

Dim Number as Integer
For Num = 10 to 20
   Print Number
Next Num
For...next loop structure

For...next loop structure

  • 2.
    At the endof this Presentation, you should be able to: 1. Define a For…Next Loop Structure 2. Understand the guidelines for a For…Next Loop Structure 3. Construct the syntax of For…Next Loop Structure
  • 3.
    For…Next Loop Structure •The For … Next is used when you know how many times the statements of the loop will be executed. It used a variable that serves as a counter that increases or decreases in value every time there is a loop.
  • 4.
    For…Next Loop StructureGuidelines • In the For … Next Loop execution: » The counter is set to the value of start. » Counter is checked if it is greater than the end. If yes, it passes to the statements after the Next, if not, the statements are executed. » The counter is incremented by the amount specified, if not specified, the counter is incremented by 1. » Counter is incremented and goes back to step b.
  • 5.
    For…Next Loop StructureSyntax For counter = start To end Statements Next
  • 6.
    Do…Until Loop StructureExample A program that print number 10 to 20. Dim Number as Integer For Num = 10 to 20 Print Number Next Num