Skip to content

continue

A syntactic looping construction used in for, while, and until loops.

Syntax

continue

Performance

The continue statement skips the rest of the following loop body instructions and proceeds with the next iteration of the loop.

Examples

Here is an example of the continue statement. It uses the file continue.csd.

Example of the continue opcode.
<CsoundSynthesizer>
<CsOptions>
-n
</CsOptions>
<CsInstruments>
0dbfs = 1

instr 1
    while (p4>0) do
        p4 = p4 - 1
        if (p4 == 2) then
            continue
        endif
        print p4
    od
endin

</CsInstruments>
<CsScore>
i1 0 0 4
</CsScore>
</CsoundSynthesizer>

Its output should include lines like this, skipping the line for 2.000:

instr 1:    p4 = 3.000
instr 1:    p4 = 1.000
instr 1:    p4 = 0.000

See also

Program Flow Control: Looping Constructions

Credits

New in Csound version 7