ArcBasicDocs

tutorials/beginner

04_loops.abs

26 lines of ArcBasic. Words in colour that are commands link to their help page. To run it, download ArcBasic, open the file and press F5.

Download 04_loops.absAll files in this folder

04_loops.abs
; Repeating things with For, While and Repeat; For counts for youFor n = 1 To 5	Print "5 x " + n + " = " + 5 * nNext; Step changes how it countsWrite "Countdown:"For n = 5 To 1 Step -1	Write " " + nNextPrint " lift off!"; While keeps going as long as something is truetotal = 0count = 0While total < 20	count = count + 1	total = total + countWendPrint "1 + 2 + ... + " + count + " = " + total + " (past 20!)"WaitKeyEnd