Quick References
ADO
ASP
CSS2
HTML
JavaScript
Jet SQL
VBScript
WML
WMLScript
WSH
XHTML
XML DOM
XSLT
Features
Knowledge Base
Tutorials
Partners
ZVON.ORG
XML
Planet Source Code
VisualBuilder
Web Design
Your HTML Source
XML/XSLT Forums
ASPAlliance
Scripts
Programmers Heaven
Tek-Tips Forums
Developer Fusion
Code Project
All Statements
STATEMENT: For
for
([initial-expression]; [condition]; [increment-expression])
{statements}
The
for
statement creates a loop consisting of three optional expressions enclosed in brackets and separated by semicolons, and a block of statements to be executed. The first expression is used to initialise a counter variable, the second (optional) provides a condition that is evaluated on each pass through the loop, and the third updates or increments the counter variable.
This example simply counts up from zero for as long as the counter is less than 10:
Code:
for(i=0; i<10; i++)
document.write(i + ".<BR>");
Copyright 1999-2005 by Infinite Software Solutions, Inc. All rights reserved.
Trademark Information