Skip to main content

continue

continue​

When this is used, it will jump to the next iteration of the loop. Unlike the break keyword, this does not stop the loop completely.

from "std" import *

vcc = supply("VCC")
gnd = dgnd()

at vcc
wire right 100

# Loop through an array of colors
for i in ["yellow", "red", "blue", "green", "purple"]:

# do not create red or green led!
if i == "red" || i == "green":
continue

add led(i) pin 2
wire right 100

add res(10k)

wire right 100 down 100
to gnd
line 6:1VCCComponent D1_1: line 16:512D1_1yellowComponent D1_3: line 16:512D1_3blueComponent D1_5: line 16:512D1_5purpleComponent R1: line 19:1R110kline 22:4GND