'FOR...NEXT Statements ' You can use this to execute a block of codes, when you know how many repetitions you want. ' it loops a group of statements a specified number of times ' The general form is ' For [variable] = [start] to [end] Step [step] ' [statements] ' Next ' [statements]
Sub Main() Dim Index As Byte Dim Sum As Byte Sum=0 For Index = 1 To 10 Step 1 Sum+=Index 'Add each integer from 1 to 10 Next Debug "1+2+...+10=", Sum End Sub
|
|