Fuze Arena Logo
  • Forum
  • Creations
    Catalogue Showcase
  • Help

repeat

Purpose

End of a loop or repeated section of code

Description

Marks the end of a section of code to be repeated. Control is passed back to the previous LOOP keyword. The loop is repeated a specified number of times or until a condition is met (or forever)

Syntax

loop ... repeat // Loop forever

while condition loop ... repeat // Loop while condition is true

for index = start to end loop ... repeat // Loop over values 

for index = start to end step amount loop ... repeat // Loop over values with step

Arguments

condition boolean condition that stops the loop when false

index loop index variable

start start value of index

end end value of index (loop is not executed with this value)

amount amount to change index variable (default is one)

Example

// Draw 100 random boxes
clear()
for i = 1 to 100 loop
    // Pick random colour
    col = { random( 101 ) / 100, random( 101 ) / 100, random( 101 ) / 100, random( 101 ) / 100 }
    x = random( gWidth() )
    y = random( gHeight() )
    width = random( gWidth() / 4 )
    height = random( gHeight() / 4 )
    outline = random( 2 )
    box( x, y, width, height, col, outline )
    update()
repeat
// Wait 3 seconds
sleep( 3 )

Associated Commands

for, repeat, step, to, while

logo

©2019 FUZE Technologies Ltd. FUZE is a registered trademark of FUZE Technologies Ltd. All rights reserved.

Useful links

  • Fuze Main Site
  • Fuze Arena on Twitter
  • Fuze Arena on Youtube
  • Download Buyer

Contact Information

  • FUZE Technologies Ltd
    15 Clearfields Farm
    Wotton Underwood
    Aylesbury, Buckinghamshire
    ​England, HP18 0RS

  • +44 (0) 1844 239 432

  • contact@fuze.co.uk

© Copyright FUZE Technologies Ltd. All rights reserved.