'----------------------------------------------------------------------- ' LOOP1.BAS ' ' CIS 120 Lecture Notes example ' Mike Huffman ' Portland Community College, Computer Information Systems ' ' Last update: 08 MAY 2002 '----------------------------------------------------------------------- ' simple loop using DO . . . WHILE CLS i% = 0 ' loop index counter maxCount% = 10 ' number of times to repeat DO WHILE i% < maxCount% PRINT i%; ' display value of loop index i% = i% + 1 ' IMPORTANT! increment the index so LOOP ' we don't have an infinite loop ' simple loop using FOR ... NEXT PRINT ' blank line for spacing FOR i = 0 TO 9 ' when the number or iterations are PRINT i; ' known in advance this form is NEXT i ' "self-documenting PRINT