Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

simple question

Status
Not open for further replies.

golyg

Programmer
Jul 22, 2002
319
US
hi all
just a quick refresher:
if I have a for loop that is set to 1 to a value like this:
For in_cur = 1 to in_num_total
...
...
code here
...
...
Next

will this loop for a total of (in_num_total - 1) times??

TIA
 
Say in_num_total = 5....

For in_cur = 1 to in_num_total
...
...
code here
...
...
Next

then it will loop for in_cur having the value 1,2,3,4,5 (so 5 times.

basically, it will loop as long as the control variable is >= the starting condition, and <= the ending condition.

:)
 
And the value of in_cur is equal to in_num_total + 1 when the loop is exited.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top