|
Microsoft® JScript for Statement |
| Language Reference |
|
Executes a block of statements for as long as a specified condition is true.
for ( initialization; test ; increment )
statementThe for statement syntax has these parts:
Part Description initialization An expression. This expression is only executed once, before the loop is executed.
test A Boolean expression. If test is true, statement is executed. If test if false, the loop is terminated. increment An expression. The increment expression is executed at the end of every pass through the loop. statement The statement to be executed if test is true. Can be a compound statement.
You usually use for loops when a loop is to be executed a specific number of times. For example:
for (i = 0; i < 10; i++) // i is set to 0 at start, and incremented
{ // by 1 at end of each iteration. Loop terminates
j *= i; // when i is not less than 10 before a loop iteration.
}
© 1996 by Microsoft Corporation.
| file: /techref/language/asp/js/202.htm, 3KB, , updated: 1996/11/22 11:11, local time: 2010/3/15 02:13,
38.107.191.114:LOG IN
|
| ©2010 These pages are served without commercial sponsorship. (No popup ads, etc...).Bandwidth abuse increases hosting cost forcing sponsorship or shutdown. This server aggressively defends against automated copying for any reason including offline viewing, duplication, etc... Please respect this requirement and DO NOT RIP THIS SITE. Questions? Please DO link to this page! Digg it! <A HREF="http://piclist.com/techref/language/asp/js/202.htm"> Microsoft® JScript Language Reference </A> |
| Did you find what you needed? |
|
|
Ubicom SX18 thru SX52, PIC 16c5X compatibile, 50 to 75 MIPS microcontrollers! Now US customers can buy the Excellent SXDev from SXList.com for $150 + $15 import fee + s&h (~ $180 total+tax in CA) |
.