<?xml version="1.0"?>
<?xml-stylesheet type="text/css" href="http://wiki.signature.net/skins/common/feed.css?270"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>http://wiki.signature.net/index.php?action=history&amp;feed=atom&amp;title=IB_Statements%2Ffor</id>
		<title>IB Statements/for - Revision history</title>
		<link rel="self" type="application/atom+xml" href="http://wiki.signature.net/index.php?action=history&amp;feed=atom&amp;title=IB_Statements%2Ffor"/>
		<link rel="alternate" type="text/html" href="http://wiki.signature.net/index.php?title=IB_Statements/for&amp;action=history"/>
		<updated>2026-05-13T02:38:13Z</updated>
		<subtitle>Revision history for this page on the wiki</subtitle>
		<generator>MediaWiki 1.16.0</generator>

	<entry>
		<id>http://wiki.signature.net/index.php?title=IB_Statements/for&amp;diff=1941&amp;oldid=prev</id>
		<title>Badge: New page: FOR statement   Syntax: FOR control-variable = start-count TO stop-count [STEP increment]   .   NEXT control-variable    Discussion: The FOR statement starts a repetitive series of program...</title>
		<link rel="alternate" type="text/html" href="http://wiki.signature.net/index.php?title=IB_Statements/for&amp;diff=1941&amp;oldid=prev"/>
				<updated>2009-08-26T11:45:45Z</updated>
		
		<summary type="html">&lt;p&gt;New page: FOR statement   Syntax: FOR control-variable = start-count TO stop-count [STEP increment]   .   NEXT control-variable    Discussion: The FOR statement starts a repetitive series of program...&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;FOR statement &lt;br /&gt;
&lt;br /&gt;
Syntax: FOR control-variable = start-count TO stop-count [STEP increment] &lt;br /&gt;
&lt;br /&gt;
. &lt;br /&gt;
&lt;br /&gt;
NEXT control-variable &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Discussion: The FOR statement starts a repetitive series of program statements (i.e., a loop). The statements following a FOR statement up to the associated NEXT statement form the loop. &lt;br /&gt;
&lt;br /&gt;
The control-variable parameter is a previously-defined numeric variable with sufficient length and precision to store the values specified by the start-count, stop-count, and increment parameters. &lt;br /&gt;
&lt;br /&gt;
The start-count parameter is the initial value assigned to the control-variable. It may be a numeric constant or numeric variable. &lt;br /&gt;
&lt;br /&gt;
The stop-count parameter is the maximum value assigned to the control-variable. Stop-count may be a numeric constant or numeric variable. When the maximum value has been reached, the statements inside the loop will be executed for a final time and program flow will continue at the statement immediately following the NEXT statement. (The control-variable will retain the maximum value assigned.) &lt;br /&gt;
&lt;br /&gt;
During the looping process, the value of the control-variable is incremented according to the increment parameter. If not specified, the increment is 1. The increment may be a numeric constant or numeric variable. &lt;br /&gt;
&lt;br /&gt;
FOR/NEXT loops may be nested to any level. &lt;br /&gt;
&lt;br /&gt;
Example 1: &lt;br /&gt;
&lt;br /&gt;
 FOR VALUE = 1 TO 250        ! Start loop from 1 to 250&lt;br /&gt;
 SQUARE = VALUE * VALUE    ! Compute square&lt;br /&gt;
 PRINT (0) VALUE;SQUARE    ! Print value and square&lt;br /&gt;
 NEXT VALUE                  ! Continue loop&lt;br /&gt;
&lt;br /&gt;
Example 2: &lt;br /&gt;
&lt;br /&gt;
 FOR LINE = 1 TO 60          ! Loop from 1 to 60&lt;br /&gt;
 READ (1,DATA) EXCP=9999   ! Read the next data record&lt;br /&gt;
 PRINT (2,INFO)            ! Print a line on the printer&lt;br /&gt;
 NEXT LINE                   ! Continue loop&lt;br /&gt;
&lt;br /&gt;
Example 3: &lt;br /&gt;
&lt;br /&gt;
 FOR I = J TO K STEP M       ! Loop using variable values&lt;br /&gt;
 PRINT (0) &amp;quot;Value is: &amp;quot;;I  ! Print the value&lt;br /&gt;
 NEXT I                      ! Continue loop&lt;br /&gt;
&lt;br /&gt;
Example 4: &lt;br /&gt;
&lt;br /&gt;
 FOR ROW = 1 TO 50             ! Start outer loop (count 1 to 50)&lt;br /&gt;
 FOR COLUMN = 1 TO 200       ! Start inner loop (count 1 to 200)&lt;br /&gt;
 SUM=SUM+DATA(COLUMN,ROW)  ! Add up array elements&lt;br /&gt;
 NEXT COLUMN                 ! Continue inner loop&lt;br /&gt;
 NEXT ROW                      ! Continue outer loop&lt;/div&gt;</summary>
		<author><name>Badge</name></author>	</entry>

	</feed>