by Dinesh Thakur Category: Lists Loops and Printing





For-Next Loop

Do-Loop construct is used when we don?t know how many iterations will be performed.

When we know the exact number of execution on the block of code, For-Next construct is used.

Do-while tests the loop condition each time through the loop & it keeps executing while the test expression is a true value

To use this construct we have to use a counter. We will always loop from star value to some end value.

In this we will have to specify the increment number.

In For-Next loop always increment by one by default

General Syntax is :

Do while <condition>



General Syntax is :

For intCounter = intStart to intend

[step to increment]


Next [intCounter]

Ex. Dim intNum as integer

Do While intNum < 100


intNum = intNum + 1


For intCount = 1 to 5

Form1. Print intCount



About Dinesh Thakur

Dinesh ThakurDinesh Thakur holds an B.C.A, MCSE, MCDBA, CCNA, CCNP, A+, SCJP certifications. Dinesh authors the hugely popular blog. Where he writes how-to guides around Computer fundamental , computer software, Computer programming, and web apps. For any type of query or something that you think is missing, please feel free to Contact us.