next repeat

Typecontrol structure
DictionaryLCS
LibraryLiveCode Script
Syntax
next repeat
Summary

Skips the rest of the current iteration and goes back to the top of the repeat structure.

Introduced1.0
OSmac, windows, linux, ios, android
Platformsdesktop, server, mobile
RelatedKeyword: end repeat, next
Glossary: current card, iteration, statement, control structure
Control Structure: if, exit repeat, repeat
Description

Use the next repeat control structure to skip part of a repeat loop.

Form: The next repeat statement appears on a line by itself, anywhere inside a repeat control structure.

The next repeat control structure skips the rest of the current iteration, and continues to the next iteration. The following example performs the loop action only if the folder's name does not begin with the character ".":

local tFolders
repeat for each line tFolder in folders(tPath)
    if tFolder begins with "." then
        next repeat
    end if
    put tPath & slash & tFolder & return after tFolders
end repeat

Usually, next repeat is used within an if control structure, so that the current iteration is skipped if a condition is true and continues if the condition is false.