Loop

Loop

Loop

Function

loop is used to repeatedly execute a section of code. BT provides three types of loops: for supports times, intervals, infinite loops and set traversals, while loops based on conditions, and loop is reserved as a compatible infinite loop writing method.

Loop control

  • break: End the current loop.
  • continue: Skip the current round and enter the next round.
  • break:label/continue:label: Control loops of specified tags in nested loops.

Examples

Syntax document

  • for: count loop, interval loop, infinite loop, and traverse arrays, objects and strings.
  • while: Loop conditionally.
  • loop: Compatible infinite loop writing method, where the loop body determines when to exit.